Remote OpenClaw Blog
How to Install Claude Code on Mac, Windows, and Linux
8 min read ·
To install Claude Code, run the native installer for your platform: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, or WSL, and irm https://claude.ai/install.ps1 | iex in Windows PowerShell. The native installer downloads a self-contained binary that does not need Node.js and auto-updates in the background, so a fresh machine is ready in under a minute. This guide covers every install path (native, Homebrew, WinGet, and npm), the Windows and WSL differences, first-run login, and the most common install errors as of July 2026.
Prerequisites and System Requirements
Claude Code runs on macOS 13.0+, Windows 10 (1809+) or Windows Server 2019+, and Linux (Ubuntu 20.04+, Debian 10+, or Alpine 3.19+), on x64 or ARM64 hardware with at least 4 GB of RAM and an internet connection. The native installer ships a standalone binary, so Node.js is not a prerequisite unless you deliberately choose the npm package.
You also need a supported account before Claude Code will do anything useful. Per Anthropic's setup documentation, that means a Pro, Max, Team, or Enterprise subscription, or an Anthropic Console account billed at API rates. The free Claude.ai plan does not grant Claude Code access. Our is Claude Code free guide breaks down which tier fits which workload.
| Method | Command | Needs Node? | Auto-updates? |
|---|---|---|---|
| Native (recommended) | curl -fsSL https://claude.ai/install.sh | bash | No | Yes |
| Homebrew (macOS/Linux) | brew install --cask claude-code | No | No (manual) |
| WinGet (Windows) | winget install Anthropic.ClaudeCode | No | No (manual) |
| npm (any platform) | npm install -g @anthropic-ai/claude-code | Yes (Node 22+) | Background |
Install Claude Code on macOS
On macOS the recommended install is the one-line native installer, which downloads the binary to ~/.local/bin and keeps itself current automatically. Open Terminal and run:
curl -fsSL https://claude.ai/install.sh | bash
Prefer a package manager? Homebrew ships two casks: claude-code tracks the stable channel (about a week behind, skipping releases with major regressions) and claude-code@latest tracks every release as it ships. Homebrew installs do not auto-update, so you upgrade with brew upgrade:
brew install --cask claude-code
# later: brew upgrade claude-code
Once the install finishes, change into any project directory and launch it with the claude command. There is a graphical Desktop app too if you would rather not live in the terminal, but the CLI is the full-featured surface most developers use.
Install Claude Code on Windows (and WSL)
Claude Code runs natively on Windows, and you do not need to run the installer as Administrator. The command you use depends on which shell you are in: PowerShell and CMD take different install lines. In PowerShell, run:
irm https://claude.ai/install.ps1 | iex
In Command Prompt (CMD), use the batch installer instead:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
A quick way to tell which shell you are in: PowerShell shows PS C:\ at the prompt, while CMD shows C:\ without the PS. If you see 'irm' is not recognized, you are in CMD, not PowerShell. WinGet is a third option: winget install Anthropic.ClaudeCode, upgraded later with winget upgrade Anthropic.ClaudeCode.
Git for Windows is optional but recommended
Git for Windows is optional on native Windows, but installing it lets Claude Code use Git Bash for its Bash tool. Without Git for Windows, Claude Code falls back to running shell commands through PowerShell instead. If Claude Code cannot find Git Bash after you install it, point to it in your settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}
Native Windows vs WSL: which to choose
The "claude code windows" decision comes down to where your projects live and whether you need sandboxing. Native Windows is best for Windows-native projects and tools; WSL 2 is best for Linux toolchains and is the only Windows option that supports Claude Code's command sandboxing. Under WSL you install and launch claude from inside the WSL terminal, not from PowerShell, using the same Linux installer as the macOS/Linux path above.
| Option | Requires | Sandboxing | Best for |
|---|---|---|---|
| Native Windows | Nothing; Git for Windows optional | Not supported | Windows-native projects and tools |
| WSL 2 | WSL 2 enabled | Supported | Linux toolchains, sandboxed command execution |
| WSL 1 | WSL 1 enabled | Not supported | When WSL 2 is unavailable |
Install Claude Code on Linux
On Linux the native installer is the same one-line command used on macOS, and it works on Ubuntu, Debian, Fedora, RHEL, and Alpine:
curl -fsSL https://claude.ai/install.sh | bash
Anthropic also publishes signed apt, dnf, and apk repositories if you prefer to manage Claude Code through your system package manager, though those installs update through your normal system upgrade workflow rather than auto-updating. On Alpine and other musl-based distributions, install libgcc, libstdc++, and ripgrep first, then set USE_BUILTIN_RIPGREP=0 in your settings, because the bundled ripgrep does not run on musl.
If your team standardizes on Node tooling, the npm package works everywhere: npm install -g @anthropic-ai/claude-code. As of v2.1.198 the npm package requires Node.js 22 or later; on older Node it prints an EBADENGINE warning but still installs, because it pulls a native binary that does not use your Node at runtime. Do not run it with sudo, which causes permission problems.
First-Run Authentication
Claude Code authenticates on first launch: run claude in a project directory and follow the browser prompt to log in. You can sign in with a Claude subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console account, and Claude Code also supports third-party providers such as Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry for teams that route through their own cloud.
cd your-project
claude
If login fails or loops, the fix is usually a stale credential or a blocked callback port. Our Claude Code login fix and OAuth error 500 fix walk through the specific cases.
Verify the Install
Confirm Claude Code is installed by printing its version, and run the built-in diagnostic if anything looks off:
claude --version
claude doctor
claude doctor checks your installation and configuration, reports the result of the most recent auto-update attempt, and lists fixes when something is wrong. If claude --version returns command not found, the binary directory is not on your PATH; on macOS and Linux that directory is ~/.local/bin, which the installer normally adds to your shell profile.
Common Install Errors and Fixes
Most Claude Code install failures fall into a handful of categories, and each has a documented fix in Anthropic's installation troubleshooting guide. The table below maps the error to the fix.
| Symptom | Likely cause | Fix |
|---|---|---|
command not found: claude | Install dir not on PATH | Add ~/.local/bin to PATH, then restart the terminal |
'irm' is not recognized | You are in CMD, not PowerShell | Use the CMD install.cmd line, or switch to PowerShell |
syntax error near unexpected token '<' or a 403 | Proxy or shell mismatch during curl | Match the error in the troubleshoot-install guide for an alternate method |
EBADENGINE on npm install | Node.js older than 22 | Upgrade to Node.js 22+; the install still completes |
| npm permission errors | Global dir not writable / used sudo | Fix npm global permissions; never use sudo npm install -g |
claude still runs after uninstall | Second install or leftover alias | Run claude doctor and remove the conflicting install |
One more Windows-specific gotcha: WinGet upgrades can fail while Claude Code is running because Windows locks the executable. Close Claude Code, then re-run winget upgrade Anthropic.ClaudeCode.
Related Guides
- Everything Claude Code: The Complete Guide
- Claude Code MCP: How to Add and Manage MCP Servers
- Claude Code Login Not Working: How to Fix It
- Is Claude Code Free? Plans That Include It
Go deeper
The operator playbooks
Production-ready PDF guides for OpenClaw and Hermes Agent — $19.99 each.
Skills for this topic
Browse all skills →Frequently Asked Questions
How do I install Claude Code?
Run the native installer for your platform: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. The installer downloads a self-contained binary that needs no Node.js and auto-updates in the background. Then run claude in any project directory and log in.
Does Claude Code require Node.js?
No, not for the recommended native installer, which ships a standalone binary. Node.js is required only if you install the npm package @anthropic-ai/claude-code , which as of v2.1.198 needs Node.js 22 or later. Even then the installed claude binary does not use Node at runtime.
How do I install Claude Code on Windows?
In PowerShell run irm https://claude.ai/install.ps1 | iex ; in CMD run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd . No Administrator rights are needed. Install Git for Windows if you want Claude Code to use the Bash tool, or choose WSL 2 if you need Linux toolchains or command sandboxing.
Is Claude Code free to install?
The Claude Code software installs at no cost, but running it requires a paid account: a Pro, Max, Team, or Enterprise subscription, or an Anthropic Console account billed at API token rates. The free Claude.ai plan does not include Claude Code access.
How do I verify Claude Code installed correctly?
Run claude --version to confirm the binary is on your PATH, and claude doctor for a full diagnostic of your installation, configuration, and most recent update. If the version command reports command not found , add the install directory ( ~/.local/bin on macOS and Linux) to your PATH and restart the terminal.





