How to Install Claude Code on Mac, Windows and Linux
One command installs Claude Code on macOS, Linux or Windows. The recommended installer and the alternatives (Homebrew, WinGet, apt, dnf, apk and npm), system requirements, signing in, checking the install with claude --version and /doctor, updating, uninstalling and the errors people hit.
7 min read
To install Claude Code, run one command in a terminal: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. That native installer is the one Anthropic recommends; it needs no Node.js and updates itself. Open a new terminal, run claude --version to confirm, then run claude in a project folder and sign in through your browser with a Pro, Max, Team or Enterprise plan or a Claude Console account. Homebrew, WinGet, Linux package managers and npm also work, but they update differently.
Before you install: system requirements
Anthropic’s advanced setup page (opens in a new tab) lists the requirements as of September 30, 2026:
- Operating system: macOS 13.0 or later; Windows 10 1809 or later, or Windows Server 2019 or later; Ubuntu 20.04 or later; Debian 10 or later; Alpine Linux 3.19 or later.
- Hardware: at least 4 GB of RAM and an x64 or ARM64 processor.
- Shell: Bash, Zsh, PowerShell or CMD, and an internet connection that can reach
downloads.claude.ai. - Location: a country Anthropic supports. Elsewhere the install URL returns a page saying the app is unavailable in your region.
- An account: Claude Pro, Max, Team or Enterprise, or a Claude Console account. The free claude.ai plan does not include Claude Code.
You do not need Node.js for the native installer, and you do not need sudo or Administrator rights to run it. If you would rather not use a terminal at all, the Claude desktop app includes Claude Code in its Code tab; Desktop app vs CLI vs VS Code compares the options.
Install on macOS and Linux
curl -fsSL https://claude.ai/install.sh | bash # Open a NEW terminal window, then claude --version
The installer puts a claude launcher in ~/.local/bin that points into ~/.local/share/claude/versions/. If the new terminal says command not found: claude, that folder is not on your PATH yet; the troubleshooting page has the one-line fix for each shell.
Homebrew, apt, dnf and apk
- Homebrew:
brew install --cask claude-codetracks the stable channel, typically about a week behind, skipping releases with major regressions.claude-code@latesttracks every release. Neither updates on its own; runbrew upgradewith the cask name you installed. - Debian and Ubuntu (apt), Fedora and RHEL (dnf), Alpine (apk): Anthropic publishes signed repositories with the same stable and latest channels. The setup page has the commands and the signing key fingerprint to check. Updates arrive with your normal system upgrades.
- Alpine and other musl-based systems also need
bash,curl,libgcc,libstdc++andripgrep, plusUSE_BUILTIN_RIPGREPset to0in settings.
Install on Windows
# PowerShell (prompt starts with PS C:\) irm https://claude.ai/install.ps1 | iex # CMD (prompt starts with C:\ and no PS) curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd # Or with WinGet (does not update itself) winget install Anthropic.ClaudeCode
Running one shell’s command in the other is the most common Windows mistake: irm is not recognized means you are in CMD, and The token && is not a valid statement separator means you are in PowerShell. Claude Code also runs inside WSL, where you use the Linux command from the distribution’s terminal instead. Which to choose, where Windows keeps settings and the Windows-only errors are all in Claude Code on Windows.
On Git for Windows, Anthropic’s pages word it two ways: the overview (opens in a new tab) calls it recommended, so Claude Code can use its Bash tool, while the setup page’s comparison table calls it optional. Both agree on the effect. Without it, Claude Code runs commands through PowerShell; with it, through Git Bash. WSL does not need it.
npm: supported, not recommended
The documentation labels the native installer as recommended. The npm package still exists and installs the same native binary through a per-platform optional dependency, so the claude it installs does not run on Node. The package itself requires Node.js 22 or later.
npm install -g @anthropic-ai/claude-code # Upgrade later (npm update -g may not move you to the newest release) npm install -g @anthropic-ai/claude-code@latest
Never use sudo npm install -g; the docs warn it leads to permission problems and security risks. If npm reports permission errors, the native installer is the simpler way out. On Windows, running scripts is disabled on this system is PowerShell blocking npm’s launcher scripts, and the PowerShell installer avoids it.
Check the install: claude --version and /doctor
claude --versionprints a version number followed by(Claude Code). Run it in a new terminal, because the window you installed from keeps its old PATH.claude doctor, run from your shell, prints read-only diagnostics without starting a session: install health, settings files that do not parse, and warnings with suggested fixes. It also shows the result of the last auto-update./doctor, typed inside a session, runs a fuller checkup: duplicate or leftover installs, PATH problems, broken settings, slow hooks and whether a newer version is out. It reports first and asks before changing anything. Its alias is/checkup.
Use claude doctor when claude will not start, and /doctor once it does.
Sign in
Run claude in a project folder. On first launch it opens your browser to log in; when it finishes the terminal says Login successful. Per the authentication page (opens in a new tab), you can sign in with a Pro or Max subscription, a Team or Enterprise account your admin invited you to, or a Claude Console account, or set up Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry instead of a browser login.
- No browser opened: press
cto copy the login URL and paste it into a browser. - WSL, SSH or a container: the browser shows a code instead of returning to the terminal. Paste it at the
Paste code here if promptedprompt. - An
ANTHROPIC_API_KEYin your environment: Claude Code asks you to approve the key instead of opening a browser, and once approved it uses the key rather than your subscription. An old key from another job is the usual cause ofThis organization has been disabled. - Check which account is active with
/status; switch with/logoutand runclaudeagain.
Updating
A native install checks for updates at startup and while it runs, installs them in the background and uses the new version next time you start it. Run claude update to update now. To trail new releases by about a week, set "autoUpdatesChannel": "stable" in ~/.claude/settings.json or choose it in /config. Homebrew, WinGet, apt, dnf and apk installs do not auto-update by default; use their own upgrade commands. To stop background updates, set DISABLE_AUTOUPDATER to "1" in the env block of your settings.
Uninstalling
rm -f ~/.local/bin/claude rm -rf ~/.local/share/claude # Optional and irreversible: settings, MCP servers, session history rm -rf ~/.claude rm ~/.claude.json
Other methods remove with their own tool: brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, npm uninstall -g @anthropic-ai/claude-code, or your package manager plus its repository file. The VS Code extension, JetBrains plugin and desktop app also write to ~/.claude, so remove them first if you want that folder gone for good. If claude still runs after uninstalling, a second install or an old shell alias is left over.
When the install fails
The error text usually names the cause. Anthropic’s installation troubleshooting page (opens in a new tab) starts with a table matching each message to a fix. The ones people hit most:
command not found: claudeorclaude is not recognized: open a new terminal; if it persists, add the install folder to your PATH.syntax error near unexpected token <or a 403: the install URL returned a web page instead of the script. That can mean an unsupported region, a proxy or a brief disruption; Homebrew or WinGet are the documented fallbacks.curl: (56) Failure writing output to destination: the download was cut off. Check you can reachdownloads.claude.aiand retry.Killedon a small Linux server: the machine ran out of memory. Free some or add swap.- TLS or certificate errors: usually a corporate proxy that inspects traffic; your CA certificates need updating or configuring.
For problems after the install, such as sign-in loops, proxies and terminal quirks, see Claude Code not working.
First thing after installing
A new install has no idea where your work list lives. If you use fenbs, connect the board once with claude mcp add --transport http fenbs https://fenbs.ai/api/mcp, then type /mcp in a session and sign in through the browser. Clients that only speak stdio use the bridge, npx -y fenbs-mcp. From then on Claude Code can read the board and the Decisions and rules page, file tasks and move them through To Do, Next Up, In Progress and Completed, with History recording each change under its name. A task-tracking workflow for Claude Code covers what to put in CLAUDE.md so it does that without being asked.
Next steps
What it is and who it suits: what is Claude Code. Your first session: Claude Code for beginners. Editor instead of terminal: Claude Code in VS Code. Connecting the board: the Claude Code integration and the MCP docs.