Installing Across Every Platform
Native, Homebrew, WinGet, npm, apt/dnf/apk
- Install Claude Code on your platform using the right method — native installer, Homebrew, WinGet, npm, or apt/dnf/apk
- Predict whether a given install method auto-updates and run the correct manual upgrade command when it does not
- Choose a release channel (latest vs stable) and pin it with autoUpdatesChannel and minimumVersion
- Confirm your machine meets the system requirements and configure Windows Git Bash and Alpine prerequisites
- Verify a working install with claude --version and diagnose problems with claude doctor
A complete, copy-paste install guide for Claude Code on macOS, Linux, WSL, and Windows, across every package manager. The one idea that ties it together: native installers auto-update, but package-manager installs do not — and that single distinction trips up more people than anything else.
- 1One mental model: who owns your updates?
- 2System requirements: check before you install
- 3Native installers (recommended): macOS, Linux, WSL, Windows
- 4Package managers: Homebrew, WinGet, npm, apt/dnf/apk
- 5Release channels: latest vs stable, and pinning versions
- 6Verify the install (and the Alpine special case)
One mental model: who owns your updates?
Before any command, hold one question in your head: after I install, who is responsible for keeping Claude Code up to date — Claude Code, or me?
That single distinction sorts every install method into two camps:
- Native installers auto-update. The
curl ... | bash/irm ... | iex/install.cmdinstallers (and the npm package, which pulls the same native binary) check for updates on startup and periodically while running, download in the background, and apply the new version next launch. You do nothing. - Package managers do NOT auto-update. Homebrew, WinGet, apt, dnf, and apk all hand update responsibility back to you. They install a binary and walk away. If you never run an upgrade command, you stay frozen on the version you installed — potentially for months — missing features and security fixes.
Everything else in this lesson — channels, version pinning, verification — hangs off that frame. Pick a method knowing which camp it's in, and you'll never be mysteriously stuck on an old version.
Claude Code is the same agentic tool regardless of how you install it; the install method only changes delivery and updates, never the product.
Key insight
The #1 install gotcha
"My Claude Code is out of date and I don't know why" is almost always a package-manager install with no upgrade habit. If you value zero-effort freshness, use the native installer. If you prefer your OS package manager to own all software (and you'll run upgrades anyway), that's fine — just commit to running the upgrade command.
System requirements: check before you install
Claude Code runs on these platforms. If you're below a minimum OS version, upgrade the OS first — installs on unsupported systems fail in confusing ways.
| Requirement | Supported |
|---|---|
| macOS | 13.0+ |
| Windows | 10 (build 1809+) or Windows Server 2019+ |
| Ubuntu | 20.04+ |
| Debian | 10+ |
| Alpine Linux | 3.19+ |
| RAM | 4 GB+ |
| CPU | x64 or ARM64 |
| Shell | Bash, Zsh, PowerShell, or CMD |
| Network | Internet connection required |
A few load-bearing notes:
- Claude Code is not on the free tier. Installing it is free; using it requires a Pro, Max, Team Premium, Enterprise, or Console account (or a cloud provider like Bedrock/Vertex/Foundry). A free Claude.ai account cannot authenticate.
ripgrepships with Claude Code on most platforms. The exception is Alpine/musl — covered later.- On Windows you choose native vs WSL: native Windows for Windows-native projects and tools; WSL 2 when you want Linux toolchains or sandboxed command execution. You install Claude Code inside whichever environment your projects live in.
Note
Where do my projects live?
On Windows, install Claude Code in the same environment as your code. If your repos are in WSL, run the Linux installer inside the WSL terminal — not from PowerShell. If your projects are native Windows folders, use the PowerShell or CMD installer.
Native installers (recommended): macOS, Linux, WSL, Windows
The native installer is the recommended path on every platform. It auto-updates, needs no Node.js, and installs a standalone binary. Pick the line for your shell.
macOS, Linux, WSL (run inside the WSL terminal for WSL):
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell:
irm https://claude.ai/install.ps1 | iexWindows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdHow do you know which Windows shell you're in? Your prompt shows PS C:\... in PowerShell and C:\... without the PS in CMD. If && errors with "The token '&&' is not a valid statement separator," you ran the CMD line in PowerShell. If 'irm' is not recognized, you ran the PowerShell line in CMD.
After it finishes, launch Claude Code from any terminal by opening your project and running:
claudeYou do not need Administrator on Windows, and you should never run the macOS/Linux installer with sudo.
Tip
Windows + Git Bash = better tooling
On native Windows, installing Git for Windows is optional but recommended: it gives Claude Code Git Bash, which enables the richer Bash tool. Without it, Claude Code falls back to the PowerShell tool. If Claude Code can't find Git Bash, point it explicitly in settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}WSL setups do not need Git for Windows.
Package managers: Homebrew, WinGet, npm, apt/dnf/apk
Prefer your OS package manager? Every major one is supported. Remember the mental model: none of these auto-update by default.
Homebrew (macOS)
Homebrew offers two casks, and the choice is your channel selection:
brew install --cask claude-code # stable channel (~1 week behind)
brew install --cask claude-code@latest # latest/rolling channelUpgrade manually with brew upgrade claude-code (or brew upgrade claude-code@latest). Homebrew keeps old versions on disk — run brew cleanup occasionally to reclaim space.
WinGet (Windows)
winget install Anthropic.ClaudeCodeUpgrade with winget upgrade Anthropic.ClaudeCode. This can fail while Claude Code is running because Windows locks the executable — close Claude Code first, then upgrade.
npm (cross-platform, needs Node.js 18+)
npm install -g @anthropic-ai/claude-codeThe npm package installs the same native binary as the standalone installer (via a per-platform optional dependency); the installed claude does not itself run Node. To upgrade, run npm install -g @anthropic-ai/claude-code@latest — not npm update -g, which respects the original semver range and may not move you to the newest release.
Linux package managers (apt / dnf / apk)
Claude Code publishes signed apt, dnf, and apk repositories. The simplest forms:
sudo apt update && sudo apt install claude-code # Debian / Ubuntu
sudo dnf install claude-code # Fedora / RHEL
apk add claude-code # AlpineThese pull from Claude Code's signed repos (you add the signing key and repo line once — see the official setup page for the full repository setup). Updates arrive through your normal system upgrade workflow (e.g. sudo apt update && sudo apt upgrade claude-code), not through Claude Code.
Watch out
Never sudo npm install
Do not run sudo npm install -g @anthropic-ai/claude-code. It causes permission and security problems with the global npm directory. If you hit permission errors, fix the npm prefix per the troubleshooting docs — do not reach for sudo.
Tip
Let Claude run the package-manager upgrade for you
On Homebrew or WinGet you can opt in to auto-upgrades by setting CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1. Claude Code then runs the upgrade in the background when a new version ships and prompts you to restart. (apt/dnf/apk still require manual upgrades because they need elevated privileges.)
Release channels: latest vs stable, and pinning versions
Claude Code ships on two channels:
latest(default) — new features the moment they're released.stable— a version typically about one week old, which skips releases with major regressions. Great for teams that value predictability over bleeding-edge.
With the native installer, the channel you choose at install time becomes your auto-update default:
curl -fsSL https://claude.ai/install.sh | bash # latest (default)
curl -fsSL https://claude.ai/install.sh | bash -s stable # stable channel
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89 # exact versionThe PowerShell equivalents pass the argument through a script block, e.g. & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable.
After install, switch channels with the autoUpdatesChannel setting (via /config -> Auto-update channel, or in settings.json):
{
"autoUpdatesChannel": "stable",
"minimumVersion": "2.1.100"
}minimumVersion sets a floor: auto-updates and claude update refuse to install anything below it, so moving from latest to stable won't downgrade you if you're already ahead. With Homebrew, the cask name is the channel (claude-code = stable, claude-code@latest = latest) — the autoUpdatesChannel setting doesn't apply there.
To force an update right now without waiting for the background check, run claude update.
Note
Turning auto-updates off
Two env-var switches, set in the env block of settings.json:
DISABLE_AUTOUPDATER=1— stops only the background check;claude updateandclaude installstill work.DISABLE_UPDATES=1— blocks all update paths, including manual ones. Use this when you distribute Claude Code through your own channel and need users pinned to the version you provide.
Verify the install (and the Alpine special case)
Two commands confirm a healthy install on every platform:
claude --version # prints the version number
claude doctor # deep install/config diagnosticsIf claude --version errors with command not found, your shell hasn't picked up the binary's directory on PATH yet — open a new terminal, or check the troubleshooting docs. claude doctor goes further: it reports the result of the most recent update attempt (invaluable when you suspect an auto-update silently failed) and lists fixes for common problems like a non-writable npm global directory.
Alpine Linux / musl: extra steps
Alpine (and other musl/uClibc-based distros) is the one platform where the native installer needs help. It requires three extra packages, and you must tell Claude Code to use the system ripgrep instead of its bundled one:
apk add libgcc libstdc++ ripgrepThen set USE_BUILTIN_RIPGREP to 0 in the env block of settings.json:
{
"env": {
"USE_BUILTIN_RIPGREP": "0"
}
}Skip either step on Alpine and you'll see the binary fail to start, or in-session code search break.
Example
A clean install-and-verify, start to finish (macOS)
# 1. Install (native, auto-updating)
curl -fsSL https://claude.ai/install.sh | bash
# 2. Verify
claude --version
claude doctor
# 3. First run: opens a browser to log in (needs Pro/Max/Team Premium/Console)
cd ~/my-project
claudeThat's the whole loop: install, verify, authenticate, work.
Try it: Install, verify, and prove you control your updates
Goal: get a working install on your machine and demonstrate that you understand the auto-update distinction.
- Check requirements. Confirm your OS meets the floor (macOS 13+, Windows 10 1809+, Ubuntu 20.04+, etc.) and you have 4 GB+ RAM.
- Install via the native installer for your platform:
- macOS/Linux/WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex - Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
- macOS/Linux/WSL:
- Verify with both
claude --versionandclaude doctor. Read the doctor output — note the line reporting the most recent update attempt. - Identify your update owner. State out loud (or in a note): is your install auto-updating or manual? For the native installer the answer is auto-updating.
- Switch channels. Open
/configand set the auto-update channel to stable, then back to latest. Inspect howautoUpdatesChannelappears in yoursettings.json. - Stretch goal: Install Claude Code a second way on the same or another machine — e.g. Homebrew (
brew install --cask claude-code) or npm (npm install -g @anthropic-ai/claude-code, no sudo). Write down the exact upgrade command that method requires, and explain why it differs from the native installer.
Done when: claude --version prints a version, claude doctor is clean, and you can state — for each method you used — who is responsible for keeping it updated and the exact command to do so.
Key takeaways
- 1Native installers (curl install.sh | bash, irm install.ps1 | iex, install.cmd) and the npm package auto-update; Homebrew, WinGet, apt, dnf, and apk do NOT.
- 2Manual upgrade commands: brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, npm install -g @anthropic-ai/claude-code@latest (never npm update -g), sudo apt upgrade claude-code.
- 3Two channels: latest (default, immediate features) vs stable (~1 week behind, skips regressions). Set with bash -s stable, the autoUpdatesChannel setting, or — for Homebrew — the cask name.
- 4Requirements: macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+, 4 GB RAM, x64/ARM64. Claude Code is not on the free tier.
- 5Never run sudo npm install -g, and never sudo the native installer. On Windows, Git for Windows is optional but unlocks the Bash tool (CLAUDE_CODE_GIT_BASH_PATH).
- 6Verify with claude --version and claude doctor. Alpine/musl needs libgcc, libstdc++, ripgrep, plus USE_BUILTIN_RIPGREP=0.
Quiz
Lock in what you learned
Check your understanding
0 / 4 answered
1.You installed Claude Code with `brew install --cask claude-code`. Weeks later a colleague mentions a feature you don't have. What's the most likely reason?
2.Which command correctly upgrades a global npm installation of Claude Code to the newest release?
3.A teammate wants updates that lag about a week behind and skip releases with major regressions, installed via the native installer. Which command fits?
4.You're setting up Claude Code on Alpine Linux with the native installer and search/startup fails. What's required?
Go deeper
Hand-picked sources to keep learning
The authoritative install reference: every platform, channel config, Linux repo setup, and uninstall steps.
What Claude Code is and how the surfaces (CLI, IDE, desktop, web) share one engine.
Plans, login methods, API keys, and CI tokens — what you need after installing.
First stop when claude --version errors, npm permissions break, or the binary is missing.
Confirms Claude Code requires Pro/Max/Team Premium/Enterprise/Console — not the free tier.
Issues, releases, and the source-of-truth repository.