---
title: "Udating Cloudflare Pages using the Wrangler cli"
description: "Before deploying to cloudflare pages with wrangler you need a cloudflare api token. You can get one at dash.cloudflare.com/profile/api-tokens."
date: 2024-04-09
published: true
tags:
  - infrastructure
  - deployment
  - cloudflare
template: til
---


Before deploying to cloudflare pages with wrangler you need a cloudflare api
token.  You can get one at
[dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens).

![cloudflare-pages-api-token.png](https://dropper.waylonwalker.com/api/file/7b566e55-98ff-4d96-b0bc-3c4e5b619d68.png)

## Install Wrangler

Next install wrangler using npm.

``` bash
npm i -g wrangler
```

## Create a Project

Before you deploy to cloudflare pages you need to create a project.  You might
already have one, or you might want to create one in the webui, but you have
the option to create it at the command line with wrangler.

``` bash
npx wrangler pages deploy markout --project-name reader-waylonwalker-com --branch markout
```

## Deploy

Now you can deploy your static application using wrangler to cloudflare pages.

> In this example I have my application built into the markout directory, and
> since the production branch is named `markout` I need to pass that in here as
> well.

``` bash
wrangler pages deploy markout --project-name reader-waylonwalker-com --branch markout
```
