The native installer is the recommended path on every platform: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, and irm https://claude.ai/install.ps1 | iex in Windows PowerShell. It bundles its own runtime, sets up PATH, and self-updates in the background. Homebrew, WinGet, apt, dnf, apk, and npm all work but none of them auto-update through Claude Code. You need a Pro, Max, Team, Enterprise, or Console account; the free Claude plan does not include Claude Code.
- Native installer is the recommended method on all platforms. No Node.js required, and it auto-updates.
- macOS, Linux, WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex. Windows CMD has its own one-liner. - npm still works but the package now requires Node.js 22 or later and installs the same native binary anyway.
- Claude Code needs a paid plan (Pro and up) or a Console account with API credit. The free Claude plan does not include it.
- Homebrew, WinGet, apt, dnf, and apk installs do not auto-update. That is the real tradeoff, not convenience.
Before you start
Claude Code system requirements, from the official setup docs, checked 7 August 2026.
| Requirement | What it needs |
|---|---|
| Operating system | macOS 13.0+, Windows 10 1809+ or Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+ |
| Hardware | 4 GB+ RAM, x64 or ARM64 |
| Shell | Bash, Zsh, PowerShell, or CMD |
| Account | Pro, Max, Team, Enterprise, or a Console account with API credit |
| Network | Internet access; check your proxy allowlist if you are behind one |
| Also useful | Git, so the agent can commit and open PRs. ripgrep ships with Claude Code except on musl distros |
macOS and Linux
Run the native installer
curl -fsSL https://claude.ai/install.sh | bash
# Pin the slower, safer channel instead
curl -fsSL https://claude.ai/install.sh | bash -s stable
# Or an exact version
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89
It detects your architecture, downloads the right binary, puts it on your PATH, and configures background self-updates. The launcher lands at ~/.local/bin/claude as a symlink into ~/.local/share/claude/versions/.
Confirm it landed
claude --version
# 2.1.211 (Claude Code)
claude doctor # read-only install and settings diagnostics
If claude is not found, your shell has not picked up the new PATH entry. Open a new terminal, or source your profile.
Authenticate
Run claude in any directory and it opens a browser on first use. If ANTHROPIC_API_KEY is set in your environment, it prompts once to approve that key instead of opening a browser.
claude
> /login # opens a browser for your Claude account
# Or use an API key instead of a subscription
export ANTHROPIC_API_KEY="sk-ant-..."
# Non-interactive machines: mint a long-lived token
claude setup-token
Start in a repository
cd ~/code/myapp
claude
# Worth it once per project: let it write a CLAUDE.md
> /init
Homebrew
Convenient if you already manage everything else that way, at the cost of updates. There are two casks and they mean different things.
brew install --cask claude-code # stable channel, about a week behind
brew install --cask claude-code@latest # every release as it ships
brew upgrade claude-code # Homebrew installs do NOT auto-update
brew cleanup # old versions stay on disk otherwise
Alpine and other musl distributions
Alpine ships without bash or curl, so the documented one-liner fails with a not found error until you add them, and the bundled ripgrep does not work on musl.
apk add bash curl libgcc libstdc++ ripgrep
# then set USE_BUILTIN_RIPGREP to "0" in the env block of settings.json
Windows
Claude Code runs natively on Windows. WSL is still a good choice if your project already lives there, but it is no longer required. Pick by where your code is and whether you want sandboxing.
| Option | Requires | Sandboxing | When to use |
|---|---|---|---|
| Native Windows | Nothing; Git for Windows is optional | Not supported | Windows-native projects and tools |
| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |
| WSL 1 | WSL 1 enabled | Not supported | Only if WSL 2 is unavailable |
Native install
irm https://claude.ai/install.ps1 | iex
# then, in a new terminal
claude --version
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
winget install Anthropic.ClaudeCode
winget upgrade Anthropic.ClaudeCode # WinGet installs do NOT auto-update
Git for Windows is optional but changes the shell tool
Without Git for Windows, Claude Code runs shell commands through the PowerShell tool. With it installed, Claude Code uses Git Bash for the Bash tool. If it cannot find Git Bash, point at it explicitly.
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}
WSL
Inside WSL, follow the Linux instructions exactly and install from the WSL terminal, not from PowerShell. The one thing that matters is where your code lives.
# Good: project on the Linux filesystem, fast
cd ~/code/myapp && claude
# Slow: project on the Windows filesystem via /mnt
cd /mnt/c/Users/you/code/myapp && claude
Filesystem calls across the /mnt boundary are dramatically slower, and an agent does thousands of them. A session that feels unusably sluggish in WSL is almost always this, not the model.
Choosing an install method
The real difference between these is not convenience, it is who owns updates. Only the native install updates itself.
| Method | Auto-updates | Best for | Watch out for |
|---|---|---|---|
| Native installer | Yes, in the background | Almost everyone | Needs a new shell for PATH to apply |
| Homebrew | No | Macs where brew manages everything | Two casks; brew cleanup to reclaim disk |
| WinGet | No | Managed Windows fleets | Upgrade fails while Claude Code is running |
| apt / dnf / apk | No | Linux servers and images | Needs the signing key registered first |
| npm | Partly, if the global dir is writable | CI images that already have Node | Deprecated; needs Node 22+; never sudo |
Linux package managers
Anthropic publishes signed apt, dnf, and apk repositories, each with a stable and a latest channel. Verify the key fingerprint before you trust it.
sudo apt install curl gnupg
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
-o /etc/apt/keyrings/claude-code.asc
# Confirm it belongs to Anthropic before continuing
gpg --show-keys /etc/apt/keyrings/claude-code.asc
# fingerprint should be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
| sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update && sudo apt install claude-code
npm, if you have a specific reason
npm install -g @anthropic-ai/claude-code
claude --version
# Upgrade: use @latest, not npm update -g, which respects the old semver range
npm install -g @anthropic-ai/claude-code@latest
# Do NOT sudo this. If you get EACCES, fix your npm prefix instead:
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
The npm package installs the same native binary as the standalone installer, pulled in through a per-platform optional dependency such as @anthropic-ai/claude-code-darwin-arm64. The installed claude binary does not invoke Node at runtime. Your package manager must allow optional dependencies, or the binary goes missing after a seemingly successful install.
Updates and release channels
A native install checks for updates on startup and periodically while running, then applies them the next time you start. Which versions it accepts is configurable, which matters for teams.
| Setting | Effect |
|---|---|
autoUpdatesChannel: "latest" | Default. New features as soon as they ship |
autoUpdatesChannel: "stable" | About a week behind, skipping releases with major regressions |
minimumVersion | A floor. Updates refuse to install below it, so moving to stable cannot downgrade you |
DISABLE_AUTOUPDATER=1 | Stops the background check only. claude update still works |
DISABLE_UPDATES | Blocks every update path, including manual |
{
"autoUpdatesChannel": "stable",
"minimumVersion": "2.1.100"
}
claude update
# Successfully updated from 2.1.203 to version 2.1.211
# or: Claude Code is up to date (2.1.211)
claude doctor # shows the result of the most recent update attempt
When it does not work
| Symptom | Cause | Fix |
|---|---|---|
claude: command not found | PATH not reloaded | Open a new terminal, or source your shell profile |
syntax error near unexpected token '<' from the installer | A proxy or captive portal returned HTML instead of the script | Fix network access, then re-run; do not pipe an unverified body to bash |
EACCES on npm install | Global npm dir owned by root | Set a user-owned npm prefix; do not sudo |
| Binary missing after npm install | Optional dependencies disabled | Allow optional deps, or use the native installer |
EBADENGINE warning | Node older than 22 | Harmless; the binary does not use your Node at runtime |
| Login loop, never authenticates | Stale credentials | Run /logout, then /login again |
| Unexpected 429 on a subscription | A stray ANTHROPIC_API_KEY in your environment | Run /status, confirm the active credential, unset the key |
| Very slow on Windows | Project on /mnt/c under WSL | Move the repo to the Linux filesystem |
| Two accounts fighting | One credential store per OS user | Isolate with CLAUDE_CONFIG_DIR |
| Anything else | Unknown | claude doctor reports install, auth, and config state |
Verifying what you downloaded
Every release publishes a manifest.json of SHA256 checksums signed with an Anthropic GPG key, so verifying the manifest transitively verifies every binary it lists. Signatures exist for releases from 2.1.89 onward.
curl -fsSL https://downloads.claude.ai/keys/claude-code.asc | gpg --import
gpg --fingerprint security@anthropic.com
# 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE
REPO=https://downloads.claude.ai/claude-code-releases
VERSION=2.1.89
curl -fsSLO "$REPO/$VERSION/manifest.json"
curl -fsSLO "$REPO/$VERSION/manifest.json.sig"
gpg --verify manifest.json.sig manifest.json
On macOS the binary is also signed by "Anthropic PBC" and notarized (codesign --verify --verbose ./claude); on Windows it is signed by "Anthropic, PBC" (Get-AuthenticodeSignature .\claude.exe). Linux binaries are not individually code-signed, which is why the manifest signature matters more there.
Running a second account
The CLI stores one credential per machine user, so a second /login replaces the first. Point each account at its own config root instead.
CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude
Worth doing right after install
- Run
/initin your main repo. It writes a CLAUDE.md describing the project, which measurably improves every later session. Then edit what it produced; the value is in what only you know. - Pick a model and effort deliberately.
/modeland/effort. Defaulting to the largest model at max effort is the fastest way to hit rate limits. - Learn
/clear,/compact, and/rewind. Context management is most of cost control. - Set up a status line. It can render context percentage and both rate-limit windows continuously, which is the cheapest early warning there is.
- Set up
gh. With the GitHub CLI authenticated, the agent can open PRs itself. - Check your plan against your usage. Pro is fine to start; the signal to upgrade is hitting limits during planned work, twice in a fortnight.
Uninstalling cleanly
Removing the binary is not the same as removing Claude Code. If claude still runs afterwards you have a second installation or a leftover shell alias.
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# Other methods
brew uninstall --cask claude-code # or claude-code@latest
winget uninstall Anthropic.ClaudeCode
sudo apt remove claude-code
npm uninstall -g @anthropic-ai/claude-code
Questions people ask
The native installer: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. It needs no Node.js and it is the only method that auto-updates.
No. The native installer bundles its own runtime. Even the npm package installs the same native binary and does not invoke Node at runtime, though as of v2.1.198 npm itself requires Node 22 or later to install it.
Yes. Install from PowerShell, CMD, or WinGet, with no Administrator rights needed. Git for Windows is optional and enables the Bash tool; without it Claude Code uses the PowerShell tool. Sandboxing is only supported under WSL 2.
No. The setup docs state that Claude Code requires a Pro, Max, Team, Enterprise, or Console account, and that the free Claude plan does not include access.
Native installs update themselves in the background; run claude update to apply one immediately. Homebrew, WinGet, apt, dnf, and apk do not auto-update: use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your usual system upgrade.
Pass it to the installer: curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89. Pass "stable" instead of a version to track the slower channel. claude --version then prints exactly what you asked for.
Almost always because the repository sits on the Windows filesystem under /mnt/c. Cross-boundary file operations are very slow and an agent makes thousands. Move the repo onto the Linux filesystem.
Import the release key from downloads.claude.ai/keys/claude-code.asc, confirm the fingerprint is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE, then gpg --verify the release manifest.json.sig against manifest.json and compare your binary's SHA256 to the manifest entry.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- Claude Code advanced setup system requirements, every install path, channels, uninstall
- Claude Code CLI reference claude doctor, update, install, setup-token
- Claude Code: troubleshoot installation and login permission and PATH failures