How to Install Wrangler: Step-by-Step Guide

Last Updated on November 10, 2026 by Jaxon Mike

The easiest way to install Wrangler is with the npm install command. You just open your terminal and run npm install -g wrangler to set it up globally. This gives you the latest version of Wrangler right away for your Cloudflare projects.

Wrangler is the official command-line tool for building on Cloudflare Workers. We found that it also handles deployments, local testing, and managing your worker configurations. You can run it through npm, Homebrew, or even directly with npx wrangler for a quick start. The right method depends on your setup and whether you want a global install or a project-specific one.

  • Global install: Run npm install -g wrangler to use it anywhere on your computer.
  • Project install: Use npm install wrangler --save-dev to keep it local to one project.
  • Quick use: Try npx wrangler --version to test it without installing anything.
  • First login: Run wrangler login to connect your Cloudflare account securely.
  • Update: Run npm update -g wrangler when you need the newest features.

Below, we walk you through the entire install process step by step. We’ll cover the main methods and show you how to verify everything works so you can start building quickly.

Setting Up Wrangler on Your Machine

Installing Wrangler takes about two minutes once you have the right tools ready. We found that the whole process boils down to three simple steps: check your system, run one command, and verify the install worked. That’s it. No complicated setup wizard, no lengthy configuration files, and no need to touch your Cloudflare account until you’re ready to deploy something.

Before you type anything into your terminal, let’s make sure your computer has the foundation Wrangler needs to run smoothly. Most of the time, this means having Node.js installed. Wrangler is a JavaScript tool, so it relies on Node to execute its commands. We found that the fastest way to check is to open your terminal and type node –version. If you see a version number like v18 or v20, you’re good to go. If you see an error, you’ll need to install Node.js first.

Checking Your Prerequisites First

Node.js is the engine that powers Wrangler, so you can’t skip this step. Many experts say that using the latest LTS (Long Term Support) version of Node is your safest bet. LTS versions receive regular updates and bug fixes for years, which means fewer surprises down the road. You can download Node.js directly from the official website, or you can use a version manager like nvm if you like to switch between Node versions for different projects.

You’ll also want a package manager. npm comes bundled with Node.js automatically, so you don’t need to install it separately. If you already use Yarn or pnpm, those work fine too, but we’ll stick with npm in this guide because it’s the most common choice. One more thing: make sure your terminal is open and ready. On Windows, that’s PowerShell or Command Prompt. On Mac, it’s Terminal. On Linux, you probably already know which terminal you like.

Using npx to Test Without Installing

Here’s a neat trick we found. If you’re not sure you want Wrangler permanently on your system, you can test it with npx wrangler –version. The npx command downloads Wrangler temporarily, runs your command, and then discards it. You get to see if Wrangler works on your machine without committing to a full install. It’s like test-driving a car before you buy it. The downside is that every npx call takes a few extra seconds because it fetches the package each time.

Installing Wrangler Globally with npm

The most popular way to install Wrangler is globally. A global install means you can run the wrangler command from any folder on your computer. This is perfect if you work on multiple Cloudflare projects and want quick access to the tool everywhere. We found that the command is refreshingly simple.

Open your terminal and type this:

npm install -g wrangler

That’s the whole command. The -g flag tells npm to install Wrangler globally. npm will download the latest version and set up the command so your terminal can find it. Depending on your internet speed, this takes anywhere from 10 seconds to a minute. You’ll see some progress bars and maybe a few warnings. Don’t panic if you see a warning about deprecated packages. That’s normal and usually harmless.

What to Do If the Global Install Fails

Sometimes, the install throws an error. We found that the most common culprit is a permission issue. On Mac and Linux, npm sometimes tries to write to a system folder that requires admin rights. If you see an error mentioning EACCES or permission denied, you have a couple of options. You can either run the command with sudo npm install -g wrangler, but that comes with its own risks. A cleaner solution is to fix your npm permissions or use a tool like nvm to manage Node entirely in your user space.

Another common issue is a slow or flaky internet connection. If npm times out, just run the same command again. npm is smart enough to resume where it left off in most cases. If you’re behind a corporate firewall or proxy, you might need to configure npm to use your proxy settings first. That’s a bit more advanced, but a quick search for “npm behind proxy” will give you the exact commands you need.

Installing Wrangler Locally for a Single Project

Some developers prefer to keep Wrangler local to one project. This approach has a clear benefit: every developer on your team uses the exact same version. No more “works on my machine” surprises. We found that local installs are the norm for larger teams and production projects where consistency matters.

To install locally, first navigate to your project folder in the terminal:

cd my-cloudflare-project

Then run:

npm install wrangler –save-dev

The –save-dev flag adds Wrangler to your package.json file as a dev dependency. This means anyone who clones your repository can run npm install and automatically get the right version of Wrangler. No guessing, no version mismatch, no drama.

Running Wrangler from a Local Install

Here’s the catch with a local install. You can’t just type wrangler dev and expect it to work. The command isn’t in your global PATH. Instead, you have two choices. You can run npx wrangler dev, which will find the local version and run it. Or you can add a script to your package.json file. Something like:

“scripts”: { “dev”: “wrangler dev” }

Then you just type npm run dev and it works. We found that this script approach is cleaner and easier to remember. Plus, it gives you a single place to manage all your common Wrangler commands.

Alternative Installation Methods Worth Knowing

npm isn’t the only way to get Wrangler on your computer. We found that Homebrew users on Mac have a dedicated option. If you have Homebrew installed, you can run brew install wrangler and it’ll handle everything for you. This is handy if you already use Homebrew to manage other development tools. It keeps all your command-line tools in one place.

For Windows users, there’s a standalone binary you can download directly from the Cloudflare website. This is useful if you don’t want to install Node.js at all. The binary runs on its own without any dependencies. We found that this option is less common, but it’s there if you need it. Linux users also have access to standalone binaries, but npm remains the most tested and supported route.

Comparing the Installation Methods

Choosing the right method depends on your workflow. Here’s a quick comparison table we put together to help you decide:

The $5,000 Car Savings Challenge

Find hidden car costs. Compare insurance, fuel, service and repair bills with a 200-page illustrated workbook and practical action sheets.

Start my audit $37
Method Best For Command
Global npm Individual developers, quick access npm install -g wrangler
Local npm Teams, consistent versions npm install wrangler –save-dev
Homebrew Mac users who love brew brew install wrangler
Standalone binary No Node.js required Download from Cloudflare

We found that most people start with the global npm install and switch to local later if they join a team. There’s no wrong answer here. Pick the one that feels most natural to you.

Verifying Your Wrangler Installation

After the install finishes, you need to confirm everything works. The simplest test is to check the version number. Type this in your terminal:

wrangler –version

You should see something like wrangler 3.x.x appear. The exact number depends on the latest release. If you see that, congratulations. You’re ready to go. If you see a “command not found” error, something went wrong. Usually, it means your terminal doesn’t know where to look for the Wrangler command. Try closing your terminal and opening a fresh one. That often fixes the PATH issue.

Running Your First Wrangler Command

Beyond checking the version, you can run a quick command to make sure Wrangler can talk to your system. Try wrangler whoami. This command checks if you’re logged into a Cloudflare account. It’s a great first test because it exercises the core functionality. If you’re not logged in, you’ll get a prompt to log in or create an account. That’s totally normal.

Logging In to Your Cloudflare Account

To actually deploy workers, you need to connect Wrangler to your Cloudflare account. The login process is secure and straightforward. Run this command:

wrangler login

Wrangler will open your default browser and take you to a Cloudflare login page. You authenticate there, and then Cloudflare gives Wrangler permission to act on your behalf. We found that this token-based approach is safer than storing your password in a config file. The token lives in your home directory and stays out of your project files.

If you’re on a remote server or a headless machine without a browser, you can use wrangler login –browser=false. This gives you a URL to visit on another device. You’ll then paste a verification code back into your terminal. It’s a bit more manual, but it works anywhere.

Keeping Wrangler Up to Date

Wrangler gets updates regularly. New features, bug fixes, and security patches come out all the time. We found that staying current is easy. If you installed globally, run:

npm update -g wrangler

For a local install, just run npm update wrangler inside your project folder. Some people set up automatic updates, but we recommend checking manually every few weeks. You can also check the official Cloudflare changelog to see what’s new before you update. That way, you know what changed and can prepare for any breaking changes.

Testing Your Setup with a Sample Project

The best way to know your install worked is to build something tiny. We found that creating a sample worker is the perfect test. Run this command to create a new project:

npm create cloudflare@latest

Follow the prompts to choose a name and a template. The default “Hello World” template is perfect for a first test. Once the project is created, navigate into its folder and run wrangler dev. This starts a local development server. Open the URL it gives you, and you should see your worker’s response. That proves your entire setup works end to end.

Your Quick Start Checklist

Here’s a simple checklist to confirm you’ve covered all the bases:

  • Node.js is installed and you can check the version in your terminal
  • Wrangler is installed either globally or in your project
  • wrangler –version returns a version number without errors
  • wrangler login completes and connects your account
  • You created a sample project with npm create cloudflare@latest
  • wrangler dev starts a local server without crashing

Working through this checklist takes about ten minutes total. When you hit the last item, you know your setup is solid. From there, you can start exploring all the powerful things Wrangler can do, like deploying workers to Cloudflare’s global network in seconds.

One last tip from our experience. If you get stuck at any point, the Cloudflare developer documentation is genuinely helpful. It’s well-organized and includes troubleshooting guides for common issues. And if you’re still stuck, the Cloudflare community forums have thousands of developers who’ve solved the same problems you’re facing. You’re never alone in this journey.

Conclusion

Getting Wrangler installed is a straightforward process once you understand the options. You can go global with npm install -g wrangler, keep things project-specific with a local install, or skip the commitment and test with npx first. We found that checking your Node.js version before you start saves you from most headaches down the road.

Your next step is simple. Run wrangler –version to confirm everything works, then log in with wrangler login. After that, create a test project and deploy your first worker. You’ll be amazed at how quick the whole flow feels once it’s set up.

Frequently Asked Questions

Do I need Node.js to install Wrangler?

Yes, for most installation methods, you need Node.js installed first. Wrangler is a JavaScript tool that runs on Node. The only exception is the standalone binary, which you can download directly from Cloudflare’s website if you want to skip Node entirely.

Can I install Wrangler on Windows without npm?

Yes, you can. Cloudflare offers a standalone binary for Windows that doesn’t require npm or Node.js. You just download the file, extract it, and run it. That said, we found that most Windows users still prefer the npm route because it makes updates easier.

What’s the difference between wrangler and wrangler2?

Wrangler2 was the previous major version of the tool. The current version is just called wrangler (v3 or newer). When you install with npm today, you automatically get the latest version. You don’t need to worry about the old naming convention anymore.

How do I uninstall Wrangler if I don’t need it anymore?

Removing Wrangler is as simple as installing it. If you installed globally, run npm uninstall -g wrangler. For a local install, navigate to your project folder and run npm uninstall wrangler. That’s it. Your project files stay untouched.

Why does wrangler login open a browser window?

That’s by design. Wrangler uses a secure token-based authentication system instead of storing your password. The browser window lets you log into Cloudflare normally, and then Cloudflare sends a verification token back to Wrangler. This keeps your credentials safe and never exposes them to the command line.

Leave a Comment