Skip to main content

Prerequisites

Before installing the Workers SDK, ensure your system meets these requirements:

Node.js

Required: Node.js 20.0.0 or higherCheck your version: node --version

Package Manager

npm, pnpm, or yarnRecommended: pnpm for faster installs

Operating System Support

Wrangler is supported on:
  • macOS: 13.5 or later
  • Windows: Windows 11
  • Linux: Distributions with glibc 2.35 or later
This follows the workerd OS support policy.

Installation Methods

There are several ways to install and use the Workers SDK depending on your workflow. The fastest way to get started is using Create Cloudflare (C3), which scaffolds a complete project:
1

Run the create command

This installs the latest version of create-cloudflare and runs the interactive setup wizard.
2

Follow the prompts

C3 will guide you through:
  • Project name and directory
  • Template selection (Hello World, frameworks, etc.)
  • TypeScript or JavaScript
  • Git initialization
  • Deployment option
3

Start developing

C3 automatically installs Wrangler and all necessary dependencies for your chosen template.

Method 2: Install Wrangler Globally

Install Wrangler globally to use it across multiple projects:
Verify the installation:
Global installations may conflict with project-specific versions. Consider using npx or project-local installations for better version control.

Method 3: Install as Project Dependency

Add Wrangler to an existing project:
1

Install Wrangler

2

Add scripts to package.json

package.json
3

Run with npm scripts

Method 4: Use npx (No Installation)

Run Wrangler commands without installing:
npx downloads and runs the latest version each time. This ensures you always have the newest version but may be slower.

Installing Additional Packages

Depending on your use case, you may want to install additional Workers SDK packages:

Miniflare (Local Development Runtime)

Miniflare is included with Wrangler but can be used standalone:
Current version: 4.20260305.0

Workers Types (TypeScript Support)

Add TypeScript definitions for the Workers runtime:
Then configure tsconfig.json:
tsconfig.json

Vitest Pool Workers (Testing)

For testing Workers with Vitest in the actual runtime:
Configure vitest.config.js:
vitest.config.js

Configuration

After installation, configure your Worker with a wrangler.jsonc, wrangler.json, or wrangler.toml file:
Use wrangler.jsonc for better editor support with comments and the $schema field for autocomplete.

Authentication

Before deploying Workers, authenticate with Cloudflare:
1

Log in to Cloudflare

This opens a browser window to authorize Wrangler.
2

Verify authentication

You should see your account email and account ID.
For CI/CD environments, use API tokens instead:
  1. Create an API token at dash.cloudflare.com/profile/api-tokens
  2. Use the “Edit Cloudflare Workers” template
  3. Set the CLOUDFLARE_API_TOKEN environment variable:
Legacy authentication (not recommended):

Version Management

Checking Versions

Check installed package versions:

Updating Packages

Keep your Workers SDK packages up to date:
To upgrade to the latest version:

Beta Releases

Beta releases are updated frequently and not suitable for production. Use only for testing unreleased features.
Install beta releases from the main branch:
Available beta packages:
  • wrangler@main
  • create-cloudflare@main
  • miniflare@main
  • @cloudflare/vitest-pool-workers@main

Workspace Setup (Monorepo)

For monorepo setups using pnpm workspaces:
pnpm-workspace.yaml
Install Wrangler at the workspace root:
Each package can have its own wrangler.jsonc configuration.

Troubleshooting

Error: This version of Wrangler requires at least Node.js v20.0.0Solution: Update Node.js using nvm or download from nodejs.org
Permission errors when installing globally:Solution: Use a Node version manager (nvm) or install in a project directory instead of globally.
Cannot find module wrangler:Solution: Ensure you’re in the correct directory and dependencies are installed:
Windows: Make sure you’re using Windows 11. Windows 10 is not supported.Linux: Verify glibc version:
You need glibc 2.35 or higher.

Next Steps

Now that you have the Workers SDK installed:

Create Your First Worker

Follow the quickstart guide to build and deploy

Configure Your Worker

Learn about configuration options

Set Up Testing

Configure Vitest for Workers testing
For detailed documentation on all configuration options, see the official Wrangler documentation.