Installing Claude Code is quicker than reading most guides about it. Anthropic ships it as a single native binary, so for most people the job is one command, a login, and a project folder to point it at. The details differ by platform, and a few of them trip people up, which is why this guide exists.
Below is every platform, first-run login, IDE setup, where config lives, updating and uninstalling, and fixes for the errors people actually hit. I run Claude Code daily on client automation and full-stack work, and every command here is pulled straight from Anthropic's official docs (linked in Sources).
Before you install
- OS: macOS 13.0+, Windows 10 version 1809+ (or Windows Server 2019+), Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+.
- Hardware: 4 GB+ RAM, x64 or ARM64. The install itself needs roughly 512 MB free memory; on a small VPS it can get OOM-killed, so add swap first.
- Network: the installer downloads from
downloads.claude.ai. - Location: an Anthropic-supported country.
- Shell: Bash, Zsh, PowerShell, or CMD all work.
Ripgrep is usually bundled with the install and only needs a separate install on Alpine/musl systems. And if you're using the native installer below, you do not need Node.js. It's a native binary that doesn't invoke Node at runtime. Node is only required for the npm install path, covered further down.
macOS, Linux, or WSL (native installer, recommended)
curl -fsSL https://claude.ai/install.sh | bash
Verify it landed, then launch:
claude --version
claude doctor
claude
claude doctor runs a fuller health check. Native installs auto-update in the background.
Alternative: Homebrew (does not auto-update; run brew upgrade claude-code yourself). Two release channels exist, pick one, don't run both:
brew install --cask claude-code
That's the stable channel, typically about a week behind the newest release. If you want the newest release instead, run brew install --cask claude-code@latest in place of the command above, not in addition to it.
Alternative: Linux package managers. Debian, Ubuntu, Fedora, RHEL, and Alpine all have signed-repo install paths documented at code.claude.com/docs/en/setup; check that page directly since the exact repo-config commands are OS-specific.
Windows, PowerShell
Open a normal PowerShell window, no need to run as Administrator.
irm https://claude.ai/install.ps1 | iex
claude --version
Git for Windows (git-scm.com/downloads/win) is optional: if it's installed, Claude Code uses Git Bash for its Bash tool; if not, it falls back to the PowerShell tool.
Alternative: WinGet (doesn't auto-update, run winget upgrade Anthropic.ClaudeCode periodically):
winget install Anthropic.ClaudeCode
Windows, Command Prompt (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
A common Windows install mistake is running the wrong command in the wrong shell. Your prompt shows PS C:\ in PowerShell and plain C:\ in CMD. 'irm' is not recognized means you're in CMD; use the command above. The token '&&' is not a valid statement separator means you're in PowerShell; use the irm command from the previous section instead.
Windows via WSL
Don't run the Windows installers from inside WSL. Open your WSL distribution's own Linux terminal and use the macOS/Linux command:
curl -fsSL https://claude.ai/install.sh | bash
Install and launch claude from inside that WSL terminal, not from PowerShell or CMD. WSL2 is recommended over WSL1, since WSL2 supports sandboxing and WSL1 doesn't. WSL1 also has a known compatibility bug that throws an "Exec format error" when running the native binary, requiring a wrapper-function workaround in ~/.bashrc if you can't upgrade.
npm (alternative, all platforms)
Most people should use the native installer above instead. It skips the Node.js requirement entirely. If you'd rather manage Claude Code through npm:
npm install -g @anthropic-ai/claude-code
This requires Node.js 22+ as of recent package versions (older Node prints a non-fatal EBADENGINE warning, but usually still works since the binary doesn't run on Node). Check your version with node --version first; if you need to install or upgrade Node, get it from nodejs.org or via nvm install 22. Never use sudo npm install -g. It causes permission problems; use the native installer instead if you hit them. Prebuilt binaries exist for darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win32-x64, win32-arm64.
Upgrade with npm install -g @anthropic-ai/claude-code@latest (not npm update -g, which respects your original semver range). Uninstall with npm uninstall -g @anthropic-ai/claude-code.
First run: logging in
Type claude. First launch opens a browser automatically for login. If it doesn't open, press c to copy the login URL and paste it manually.
In WSL2, SSH sessions, or containers, the browser often can't reach Claude Code's local callback server, so it shows a login code to paste into the terminal instead. claude auth login is a fallback that reads a pasted code from stdin if terminal paste isn't cooperating. Success shows "Login successful."
Account types that work: Claude Pro or Max (your Claude.ai account, the recommended path for individuals); Claude for Teams or Enterprise (same account, admin-invited); Claude Console (API billing, admin invites you, a "Claude Code" workspace auto-creates for cost tracking); cloud provider access via Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry (set env vars first, no browser login needed); a self-hosted cloud gateway with corporate SSO via /login.
Setting ANTHROPIC_API_KEY (X-Api-Key header) or ANTHROPIC_AUTH_TOKEN (Bearer header) skips the browser flow entirely. You're prompted once to approve the detected key. For CI with no browser at all, run claude setup-token once interactively to mint a 1-year OAuth token, then export it as CLAUDE_CODE_OAUTH_TOKEN.
Credentials are stored locally once you're in: encrypted Keychain on macOS, ~/.claude/.credentials.json (mode 0600) on Linux, %USERPROFILE%\.claude\.credentials.json on Windows, so you won't be prompted again until they expire. Use /login to switch accounts, /logout to sign out.
Using it in your editor: VS Code and JetBrains
VS Code. Search "Claude Code" in the Extensions view (Cmd/Ctrl+Shift+X), or open the direct link vscode:extension/anthropic.claude-code (also works in Cursor via cursor:extension/anthropic.claude-code and other forks via Open VSX). Needs VS Code 1.98.0+ and a paid subscription or Console account, sign in via a browser prompt on first open.
The part people miss: the extension bundles its own private CLI for the chat panel only. It does not add claude to your shell PATH. To run claude in the integrated terminal, install the standalone CLI separately using the commands above. The extension adds inline diff review, @-mentions, plan-review mode, checkpoints/rewind, MCP management via /mcp, and a loopback-only local IDE MCP server that shares diagnostics and selection with the CLI.
JetBrains. Install "Claude Code [Beta]" from the JetBrains Marketplace, then restart the IDE. Works with IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, GoLand, and most other JetBrains IDEs. Unlike VS Code, the plugin does not bundle its own CLI. It runs claude in the IDE's integrated terminal, so the standalone CLI must already be installed and on PATH (or set a custom path under Settings > Tools > Claude Code [Beta]). Quick-launch with Cmd/Ctrl+Esc, reference a file with Cmd+Option+K (Mac) or Alt+Ctrl+K (Win/Linux). WSL2 users seeing "No available IDEs detected" may need a Windows Firewall rule or mirrored networking.
Where config lives: CLAUDE.md and settings.json
CLAUDE.md gives Claude Code persistent memory: ~/.claude/CLAUDE.md (user-level, all projects), CLAUDE.md or .claude/CLAUDE.md at repo root (project-level, meant to be committed and shared), .claude/CLAUDE.local.md (personal, that repo only, not shared).
settings.json controls permissions, env vars, MCP servers, hooks, model selection, and the update channel: ~/.claude/settings.json (user-level), .claude/settings.json at repo root (project-level, committed), .claude/settings.local.json (personal, gitignored automatically). Managed/enterprise settings are read-only, delivered via MDM on macOS, the HKLM\SOFTWARE\Policies\ClaudeCode registry key on Windows, or /etc/claude-code/managed-settings.json on Linux. Precedence: Managed > CLI args > Local > Project > User, except permission rules, which merge instead of override. On Windows, ~/.claude resolves to %USERPROFILE%\.claude. MCP server config lives separately, at ~/.claude.json (user) and .mcp.json at repo root (project). For a worked example of adding an MCP server, see how I connect Claude Code to n8n and keep it away from production workflows.
Updating and uninstalling
Update. Native installs auto-update in the background on startup; run claude update to force it now, or claude doctor to check the last result. Set the channel with {"autoUpdatesChannel": "stable"} (or "latest") in settings.json, or /config. Homebrew, WinGet, and Linux package manager installs don't auto-update. Run brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your package manager's upgrade command manually (or set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 for Homebrew/WinGet to do it in the background). npm: npm install -g @anthropic-ai/claude-code@latest.
Uninstall. macOS/Linux/WSL native: rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude. Windows PowerShell: remove $env:USERPROFILE\.local\bin\claude.exe and $env:USERPROFILE\.local\share\claude with Remove-Item. Homebrew: brew uninstall --cask claude-code. WinGet: winget uninstall Anthropic.ClaudeCode. npm: npm uninstall -g @anthropic-ai/claude-code.
To fully wipe config and session history afterward (irreversible): rm -rf ~/.claude && rm ~/.claude.json, plus rm -rf .claude && rm -f .mcp.json inside any project you used it in. One catch: if the VS Code extension, JetBrains plugin, or a desktop app is still installed, ~/.claude/ gets recreated the next time you open one of them. Uninstall those first for a truly clean removal.
Troubleshooting common install problems
command not found: claude/ not recognized (PATH issue). The binary lands at~/.local/bin/claude(macOS/Linux) or%USERPROFILE%\.local\bin\claude.exe(Windows) but isn't always on PATH. Check withecho $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin", then add it:echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc(or~/.bashrc). On Windows, set the User PATH var with[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ";$env:USERPROFILE\.local\bin", 'User'), then restart your terminal. The VS Code extension alone does not addclaudeto PATH.- Wrong Windows shell command.
'irm' is not recognizedmeans CMD; use the CMD installer.The token '&&' is not a valid statement separatormeans PowerShell; useirm. - npm permission errors (
EACCES). Don't usesudo npm install -g. Use the native installer instead. If the native installer itself hits permission errors:test -w ~/.local/bin, thensudo mkdir -p ~/.local/bin && sudo chown -R $(whoami) ~/.local. Could not find native binary package "@anthropic-ai/claude-code-<platform>". Either optional dependencies are disabled (remove--omit=optional/--no-optional/an.npmrcoptional=falsesetting and reinstall) or your platform isn't among the supported npm targets listed above.exec: node: not foundin WSL. WSL is picking up the Windows Node install. Check withwhich node; paths under/mnt/c/are Windows binaries. Install Node via your Linux distro's package manager or nvm, or trynpm config set os linuxplusnpm install -g @anthropic-ai/claude-code --force(no sudo).- TLS/SSL errors behind a corporate proxy. Update CA certs (
sudo apt-get install ca-certificates), install withcurl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash, then setexport NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pemfor Claude Code itself afterward. ANTHROPIC_API_KEYsilently overriding a subscription, causing "This organization has been disabled." A leftover exported key takes precedence over subscription OAuth. Fix:unset ANTHROPIC_API_KEY; remove any export line from your shell profile; runclaudeagain; confirm with/status.- OAuth login hangs in WSL2, SSH, or containers. The browser can't reach the local callback, so it shows a code. Paste that into the terminal. If the browser won't open from WSL2, set
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"first, or useclaude auth login.
Which plan do you need?
Installing is free. Running it isn't. Per Anthropic's setup docs, Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free Claude.ai plan does not include access. A Claude Console (API, pay-as-you-go) account works too, and so does cloud provider access through Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry.
Which one makes financial sense depends on how you'll use it. I broke every current price down with sources in Claude Code Pricing Explained, and built a free cost calculator that runs your own usage pattern against the real numbers instead of a guess.
Ready to skip the DIY setup?
If you'd rather have this, and the automation workflows, agents, and integrations built around it, set up correctly for your team the first time, that's what I do for clients. Book a 30-minute call and we'll figure out what needs building versus what you can run yourself.
Sources
- code.claude.com/docs/en/quickstart: canonical setup root
- code.claude.com/docs/en/setup: system requirements, install commands, plan requirements, package manager instructions
- code.claude.com/docs/en/authentication: login flow, account types, API key auth, credential storage
- code.claude.com/docs/en/troubleshoot-install: install-specific error fixes
- code.claude.com/docs/en/troubleshooting: general troubleshooting
- code.claude.com/docs/en/vs-code: VS Code extension setup and behavior
- code.claude.com/docs/en/jetbrains: JetBrains plugin setup and behavior
- code.claude.com/docs/en/settings: CLAUDE.md and settings.json locations, precedence
- npmjs.com/package/@anthropic-ai/claude-code: npm package listing (check directly for current version)
- claude.com/pricing: plan requirements for Claude Code access
All install commands and setup facts verified against the official Anthropic documentation listed above as of July 2026. Anthropic updates these docs and pricing periodically, check the linked pages directly before a large team rollout.
Frequently asked questions
How do I install Claude Code?
On macOS, Linux, or WSL, run curl -fsSL https://claude.ai/install.sh | bash in your terminal. On Windows, open PowerShell and run irm https://claude.ai/install.ps1 | iex, or use curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd from CMD. You can also install via npm with npm install -g @anthropic-ai/claude-code if you have a recent Node.js version (22+ as of this writing). After installing, type claude in your terminal to launch it and complete first-run login.
Does Claude Code work on Windows?
Yes. Claude Code supports Windows 10 version 1809+ and Windows Server 2019+ natively, with dedicated install commands for both PowerShell and CMD. Git for Windows is optional; if it's installed, Claude Code uses Git Bash for its Bash tool, and if it's absent, it falls back to the PowerShell tool. It also works inside WSL, where WSL2 is recommended over WSL1 for sandboxing support.
How do I update Claude Code?
The native installer auto-updates in the background on startup, and you can force an immediate update by running claude update, or check the last update result with claude doctor. If you installed via Homebrew, WinGet, or a Linux package manager, those do not auto-update by default, so you need to run brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your package manager's upgrade command manually. If you installed via npm, run npm install -g @anthropic-ai/claude-code@latest (not npm update -g).
How do I log into Claude Code?
Type claude in your terminal. On first launch it opens a browser window automatically for login; if it doesn't open, press c to copy the login URL and paste it manually. In WSL2, SSH sessions, or containers where the browser can't reach the local callback server, you'll see a login code to paste back into the terminal instead. Once logged in, credentials are stored locally so you won't need to log in again until they expire; use /login to switch accounts or /logout to sign out.
Is Claude Code free?
The CLI download itself is free, but running it requires a paid account: Claude Code needs a Pro, Max, Team, Enterprise, or Console account, and the free Claude.ai plan does not include access, per Anthropic's official setup docs. A Claude Console (API, pay-as-you-go) account also works, and cloud provider access through Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry counts as a valid path too. For exact current prices, see the dedicated pricing breakdown linked in this post.
How do I use Claude Code in VS Code?
Search "Claude Code" in the VS Code Extensions view (Cmd/Ctrl+Shift+X) and install it, or use the direct link vscode:extension/anthropic.claude-code (it also works in Cursor and other VS Code forks via Open VSX). The extension requires VS Code 1.98.0+ and a paid Claude subscription or Console account. Important: the extension bundles its own private CLI copy for the chat panel only. It does not add claude to your shell PATH, so to run claude in the integrated terminal you still need to install the standalone CLI separately.