← Blog

How to Install Claude Code on Mac, Windows, and Linux

August 26, 2026

Installing Claude Code takes one command on every platform it supports. The part people get wrong is which command, and what to do when the terminal answers back with something unexpected.

Here is the short version:

PlatformCommand
macOS, Linux, WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
macOS via Homebrewbrew install --cask claude-code
Windows via WinGetwinget install Anthropic.ClaudeCode
Any platform via npmnpm install -g @anthropic-ai/claude-code

Two things worth knowing before you start. Windows is natively supported — you no longer need WSL just to run the tool, though WSL is still the better choice for some workloads. And Claude Code requires a paid Claude plan or a Console account; the free Claude.ai tier does not include it.

The rest of this guide covers requirements, the per-platform detail, how to confirm the install actually worked, and how upgrades behave differently depending on how you installed.

Check the requirements first

Most failed installs are a requirements problem wearing a disguise. Anthropic's setup documentation lists the supported configurations:

RequirementWhat's supported
macOS13.0 or later
WindowsWindows 10 1809+ or Windows Server 2019+
LinuxUbuntu 20.04+, Debian 10+, Alpine Linux 3.19+
Hardware4 GB+ RAM, x64 or ARM64 processor
ShellBash, Zsh, PowerShell, or CMD
NetworkInternet connection required

Note what is not on that list: Node.js. The native installer ships a standalone binary, so you do not need Node at all unless you deliberately choose the npm route. That trips up people who read older guides where npm was the only option.

Claude Code is also region-gated to Anthropic's supported countries, which is a genuinely common reason an install completes and then login fails.

Install Claude Code on macOS

The native installer is the recommended path:

curl -fsSL https://claude.ai/install.sh | bash

That downloads a signed binary, puts the launcher at ~/.local/bin/claude, and keeps versions under ~/.local/share/claude/versions/. Native installs update themselves in the background, which is the main practical reason to prefer them.

brew install claude-code

If you manage everything through Homebrew, there is an official cask:

brew install --cask claude-code

There are actually two casks, and the difference matters. claude-code follows the stable channel — typically about a week behind, skipping releases with known major regressions. claude-code@latest gets every release the day it ships. Pick stable if Claude Code is part of your working day and you would rather not be the person who finds the regression.

The tradeoff: Homebrew installs do not auto-update. You upgrade manually with brew upgrade claude-code (or brew upgrade claude-code@latest). Homebrew also keeps old versions around, so run brew cleanup occasionally.

Run Claude Code on Windows

This is the section that has changed most. For a long stretch, running Claude Code on Windows meant running it inside Linux. That is no longer true — you can install and run it natively from PowerShell or CMD, without Administrator rights.

PowerShell:

irm https://claude.ai/install.ps1 | iex

CMD:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Running the wrong one is the single most common Windows error, and the error message tells you which shell you are actually in. The token '&&' is not a valid statement separator means you are in PowerShell. 'irm' is not recognized means you are in CMD. Your prompt is the giveaway: PowerShell shows PS C:\, CMD shows C:\ with no PS.

There is also a WinGet package:

winget install Anthropic.ClaudeCode

Like Homebrew, WinGet does not auto-update — run winget upgrade Anthropic.ClaudeCode periodically.

Native Windows or WSL?

Both work. They are good at different things:

OptionRequiresSandboxingBest for
Native WindowsNothing; Git for Windows optionalNot supportedWindows-native projects and tooling
WSL 2WSL 2 enabledSupportedLinux toolchains, sandboxed command execution
WSL 1WSL 1 enabledNot supportedFallback when WSL 2 is unavailable

Pick based on where your code actually lives. If your projects sit in a Windows directory and you build with Windows tooling, install natively. If you already work inside WSL, open your distribution and run the Linux command there — you install and launch claude inside the WSL terminal, not from PowerShell.

One optional extra for native Windows: installing Git for Windows gives Claude Code access to Git Bash, so it can use its Bash tool. Without it, Claude Code falls back to running shell commands through PowerShell. Neither is broken; the Bash path just matches more of what you will find in shared setups and documentation. WSL users do not need it.

Install Claude Code on Linux

Same native installer as macOS:

curl -fsSL https://claude.ai/install.sh | bash

Anthropic also publishes signed apt, dnf, and apk repositories for Debian/Ubuntu, Fedora/RHEL, and Alpine, each with a stable and a latest channel. Those are the right choice if your machine is managed by configuration tooling and you want Claude Code to arrive through the same upgrade path as everything else — the same argument that makes teams standardise on Ansible rather than hand-running installers. Package-manager installs do not auto-update through Claude Code; they update when the system does.

Alpine and other musl-based distributions need a bit of setup first, because Alpine ships without bash or curl. Install bash, curl, libgcc, libstdc++, and ripgrep, then set USE_BUILTIN_RIPGREP to 0 in your settings file.

The npm install, and when not to use it

npm still works and installs the same native binary:

npm install -g @anthropic-ai/claude-code

As of v2.1.198 the package wants Node.js 22 or later. On an older Node it prints an EBADENGINE warning rather than failing, and claude still runs — the binary does not use your Node at runtime. npm pulls it in as a per-platform optional dependency, so your package manager has to allow optional dependencies.

Two rules here. Never run sudo npm install -g — it creates permission problems and is a security risk. And when upgrading, use npm install -g @anthropic-ai/claude-code@latest rather than npm update -g, which respects the semver range from your original install and may quietly leave you behind.

Honestly, unless you have a specific reason to want npm in the loop, the native installer is less to go wrong.

Verify the install, then log in

claude --version

A working install prints something like 2.1.211 (Claude Code). For a fuller picture, run:

claude doctor

That prints read-only diagnostics without starting a session — install health, settings-file validation errors, and the result of the most recent update attempt. It is the first thing to run when something feels off, and it is far more useful than re-running the installer.

To start working, open a terminal in your project and run claude. You will be prompted to log in through the browser. If you have ANTHROPIC_API_KEY set, Claude Code asks you to approve that key instead.

Authentication needs a Pro, Max, Team, Enterprise, or Console account — the free Claude.ai plan does not include Claude Code access. You can also point it at a third-party provider like Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry.

How to upgrade Claude Code

Upgrade behaviour depends entirely on how you installed:

Install methodAuto-updates?Manual upgrade command
Native installerYes, in the backgroundclaude update
HomebrewNobrew upgrade claude-code
WinGetNowinget upgrade Anthropic.ClaudeCode
apt / dnf / apkNoYour normal system upgrade
npmOnly if the global dir is writablenpm install -g @anthropic-ai/claude-code@latest

Native installs check for updates at startup and periodically while running, download in the background, and apply the new version the next time you start. claude update forces it immediately and reports either Successfully updated from <old> to <new> or Claude Code is up to date.

You can control the channel with the autoUpdatesChannel setting — "latest" by default, or "stable" for a version roughly a week old that skips major regressions. There is also minimumVersion, which stops an update from downgrading you, and DISABLE_AUTOUPDATER if you distribute Claude Code through your own channel and need everyone pinned.

When the install is not the actual problem

Getting claude --version to print is the easy part. The harder part comes next, and it is worth being honest about it: a working Claude Code install is a blank terminal that does nothing useful until you know what to ask it, what to put in a CLAUDE.md, and which skills and MCP servers make it good at your particular work.

That gap is why so many people install a coding agent, run it twice, and never open it again. The tool is fine. The configuration someone else spent three months developing is the thing that was actually impressive in the demo you saw.

If the setup step is where you keep stalling — or if you got Claude Code installed and still cannot reproduce the workflow you saw someone post — Taku mirrors a working AI setup into a desktop workspace and runs it, so you can use a power user's configuration without rebuilding their environment first. You can browse what other people have already got working in the free app library, and see how the same idea applies beyond coding in our guide to AI agent builders. Taku is in Beta, and the Mac app is available now.

FAQ

What is the Claude Code install command?

curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL. On Windows it is irm https://claude.ai/install.ps1 | iex in PowerShell, or the curl ... install.cmd variant in CMD. Homebrew, WinGet, npm, apt, dnf, and apk are all supported alternatives.

Can I run Claude Code on Windows without WSL?

Yes. Native Windows installation is supported on Windows 10 1809+ and Windows Server 2019+, and you do not need Administrator rights. WSL 2 remains worth choosing if you need sandboxed command execution or your projects live in a Linux toolchain.

Do I need Node.js to install Claude Code?

No. The native installer, Homebrew, WinGet, and the Linux package repositories all ship a standalone binary. Node.js 22+ is only required if you specifically install through npm — and even then the installed binary does not use Node at runtime.

How do I install Claude Code on a Mac with Homebrew?

brew install --cask claude-code for the stable channel, or brew install --cask claude-code@latest for every release as it ships. Remember that Homebrew installs do not auto-update; you will need brew upgrade.

Is Claude Code free?

No. It requires a paid Claude plan — Pro, Max, Team, or Enterprise — or an Anthropic Console account. The free Claude.ai plan does not include access. Current plan details are on Anthropic's site.

How do I check whether my install is broken?

Run claude doctor. It prints installation and configuration diagnostics without starting a session, including settings-file errors and whether the last update attempt succeeded. If claude still runs after you thought you uninstalled it, you probably have a second install or a leftover shell alias.

Key points

  • The native installer is one command on every platform and is the only method that auto-updates by default.
  • Native Windows support is real — WSL is now a choice about sandboxing and toolchain, not a requirement.
  • Node.js is optional. Only the npm route needs it, and only at install time.
  • claude --version confirms the install; claude doctor diagnoses it.
  • Homebrew, WinGet, and Linux package installs need manual upgrades, so pick your channel deliberately.
  • Installing the tool is the small problem. Knowing what to run inside it is the large one.