Cloudflare Docs
Workers
Visit Workers on GitHub
Set theme to dark (⇧+D)

Get started with Wrangler

wrangler is a command line tool for building Cloudflare Workers.

1. Install the Workers CLI

Installing wrangler, the Workers CLI, allows you to init, dev, and publish your Workers projects.

To install wrangler, ensure you have npm installed, preferably using a Node version manager like Volta or nvm to avoid permission issues or to easily change Node.js versions, then run:

$ npm install -g wrangler

or install with yarn:

$ yarn global add wrangler

2. Authenticate

With installation complete, wrangler will need access to a Cloudflare OAuth token to manage Workers resources on your behalf.

Run the command wrangler login, which will automate this process.

Wrangler will attempt to automatically open your web browser to complete the login process to your Cloudflare account. If you have issues completing this step or you do not have access to a browser GUI, you can copy and paste the URL generated by wrangler login in your terminal into a browser and log in.

$ wrangler login
⛅️ wrangler 2.0.7
-----------------------------------------------------
Attempting to login via OAuth...
Successfully logged in.

Open the browser, log in to your account, and select Allow. This will send an OAuth Token to Wrangler so it can deploy your scripts to Cloudflare.


With Wrangler successfully installed, refer to Commands and Configuration to continue building with Wrangler.