How to Install Claude Code on Windows, Mac and Linux
Claude Code installs with one command: irm https://claude.ai/install.ps1 | iex in Windows PowerShell, or curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL. You don’t need Node.js. You do need a paid Claude plan (Pro, Max, Team or Enterprise) or an Anthropic Console account, because the free plan doesn’t include Claude Code.
That’s the short version. The longer version matters on Windows, where the installer finishes with a success message and then claude still isn’t recognized. I installed it on a Windows 11 Pro laptop on October 28, 2026 (Claude Code 2.1.312), and the real output from that install is below, along with the fix. The macOS and Linux steps follow Anthropic’s setup documentation, checked the same day.
Pick the command for your system
| System | Where to run it | Command |
|---|---|---|
| Windows 10 (1809+) or 11 | PowerShell (prompt starts with PS C:\) |
irm https://claude.ai/install.ps1 | iex |
| Windows 10 or 11 | Command Prompt (prompt starts with C:\, no PS) |
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd |
| macOS 13 or later | Terminal | curl -fsSL https://claude.ai/install.sh | bash |
| Ubuntu 20.04+, Debian 10+, Alpine 3.19+ | Terminal | curl -fsSL https://claude.ai/install.sh | bash |
| WSL (Ubuntu etc. on Windows) | Inside the WSL terminal | curl -fsSL https://claude.ai/install.sh | bash |
Anthropic lists the same minimum hardware for every platform: 4 GB of RAM and an x64 or ARM64 processor, plus an internet connection and a location in one of Anthropic’s supported countries. You don’t need administrator rights on Windows or sudo on Mac and Linux for the native installer.
What the Windows install actually looks like
I ran the PowerShell command in a normal (non-admin) PowerShell window. Two things surprised me.
It shows nothing for minutes: the command printed no progress bar while it downloaded. On my connection the whole install took 478 seconds, close to eight minutes, and the downloaded program alone was 298,690,208 bytes (about 285 MB). If your window looks frozen, check whether %USERPROFILE%\.local\share\claude\versions is filling up before you cancel anything.
“Successfully installed” doesn’t mean you can run it yet: this is the full output I got (my Windows username replaced with YourName):
Setting up Claude Code...
Checking installation status...
Installing Claude Code native build latest...
Setting up launcher and shell integration...
‼ Setup notes:
● Native installation exists but C:\Users\YourName\.local\bin is not in your PATH. Add it by opening: System Properties → Environment Variables → Edit User PATH → New → Add the path above. Then restart your terminal.
√ Claude Code successfully installed!
Version: 2.1.312
Location: C:\Users\YourName\.local\bin\claude.exe
Next: Run claude --help to get started
✅ Installation complete!
The installer put claude.exe in place but didn’t add its folder to my PATH, the list of folders Windows searches when you type a command. Typing claude --version straight afterwards gave the classic error:
claude : The term 'claude' is not recognized as the name of a cmdlet, function,
script file, or operable program.
One more detail from my machine: the Claude desktop app was already installed and working, and claude still wasn’t available in the terminal. According to Anthropic’s docs, the VS Code extension bundles a private copy of Claude Code that isn’t added to PATH, and on my PC the desktop app hadn’t added one either. If you want to type claude in a terminal, you need this install even if you already use one of those.
Fix “claude is not recognized” on Windows
The installer’s note suggests clicking through System Properties. The quicker route is to paste these two lines into PowerShell. They add %USERPROFILE%\.local\bin to your user PATH permanently and don’t need admin rights:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Then close every terminal window and open a new one. Windows only reads PATH when a window starts, and a terminal inside VS Code or Cursor takes its PATH from the editor, so restart the editor too. In my fresh window, both checks passed:
PS> claude --version
2.1.312 (Claude Code)
PS> where.exe claude
C:\Users\YourName\.local\bin\claude.exe
If where.exe claude instead says INFO: Could not find files for the given pattern(s)., the program isn’t installed at all. Run Test-Path "$env:USERPROFILE\.local\bin\claude.exe": False means the install didn’t finish, so run it again.
Wrong shell? Two errors give it away
Windows has two command lines, and each install command only works in one of them:
'irm' is not recognized as an internal or external commandmeans you pasted the PowerShell command into Command Prompt.The token '&&' is not a valid statement separatormeans you pasted the Command Prompt command into older Windows PowerShell.
Look at your prompt: PS C:\Users\YourName> is PowerShell, and the same line without PS is Command Prompt. Also avoid the “Windows PowerShell (x86)” entry in the Start menu. Claude Code doesn’t support 32-bit Windows, and the x86 shell makes the installer think you’re on it.
Do you need Git for Windows?
No, but it’s worth installing. Without Git for Windows, Claude Code runs its shell commands through PowerShell. With it, Claude Code uses Git Bash, which most tutorials and scripts assume, and you get git for undoing changes Claude makes. If Claude Code can’t find Git Bash after you install it, point to it in %USERPROFILE%\.claude\settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}
Native Windows or WSL?
| Native Windows | WSL 2 | |
|---|---|---|
| Setup | The PowerShell command above | Enable WSL 2, then run the Linux command inside it |
| Best for | Projects that live in Windows folders and use Windows tools | Linux toolchains, Docker-heavy projects |
| Sandboxed commands | Not supported | Supported |
Where to type claude |
PowerShell or Command Prompt | The WSL terminal only |
If you go the WSL route, keep the project inside the Linux file system (/home/you/...) rather than /mnt/c/. Searching across the Windows file system from WSL is slow and can return fewer matches.
Installing on a Mac
Open Terminal (Cmd+Space, type “Terminal”) and run:
curl -fsSL https://claude.ai/install.sh | bash
The program lands at ~/.local/bin/claude. If a new Terminal window then says zsh: command not found: claude, add that folder to your PATH. zsh is the default shell on current macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
If you use Bash on a Mac, write the line to ~/.bash_profile instead of ~/.bashrc. Terminal starts Bash as a login shell, which skips ~/.bashrc.
Prefer Homebrew: brew install --cask claude-code installs the stable channel, which runs about a week behind and skips releases with major regressions. claude-code@latest follows every release. Homebrew installs don’t update themselves, so run brew upgrade claude-code now and then.
Installing on Linux (Ubuntu, Debian, Fedora, Alpine)
On a desktop or a VPS, the same one-line script works:
curl -fsSL https://claude.ai/install.sh | bash
On Ubuntu and Debian the default shell is Bash, so the PATH fix goes into ~/.bashrc:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Using apt or dnf on servers
Ubuntu’s own repositories don’t carry Claude Code, so sudo apt install claude-code fails until you add Anthropic’s signed repository. On managed servers that’s often the better choice, because updates then arrive with your normal system upgrades. For Debian and Ubuntu (stable channel):
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
gpg --show-keys /etc/apt/keyrings/claude-code.asc
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
Before you trust the key, check that gpg --show-keys prints the fingerprint 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. Fresh installs may lack curl or gpg; sudo apt install curl gnupg adds both. On Fedora and RHEL, Anthropic publishes a dnf repository at https://downloads.claude.ai/claude-code/rpm/stable, and the setup page has the repo file to paste.
Alpine and other musl distributions
Alpine ships without Bash and curl, so the script fails with not found until you add them, plus the runtime libraries Claude Code needs:
apk add bash curl libgcc libstdc++ ripgrep
Then set USE_BUILTIN_RIPGREP to 0 in the env section of ~/.claude/settings.json, so Claude Code uses the system copy of ripgrep for file search.
“Killed” on a small VPS
If the install stops with Killed or Installation was killed before it could finish (exit code 137), the server ran out of memory. The install step alone needs roughly 512 MB free. On a 1 GB instance, add a swap file and run the script again:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Check the install with claude doctor
claude --version only proves the command runs. claude doctor checks the install itself without starting a session. This is the relevant part of mine, run before I fixed PATH:
Claude Code doctor
Running: native (2.1.312)
Platform: win32-x64
Path: C:\Users\YourName\.local\bin\claude.exe
Config install method: native
Search: OK (bundled)
Auto-update channel: latest
...
1 warning found
- Native installation exists but C:\Users\YourName\.local\bin is not in your PATH
The lines to read are Running (your install method and version), Search (whether file search works) and any warnings, which come with a suggested fix. If doctor lists two installs, for example an old npm copy and the native one, remove the one you don’t use so the wrong version doesn’t start.
Checking the download is genuine: on Windows, Get-AuthenticodeSignature "$env:USERPROFILE\.local\bin\claude.exe" returned Status: Valid with the signer CN="Anthropic, PBC" on my copy. On a Mac, codesign --verify --verbose ~/.local/bin/claude does the same job. Linux binaries aren’t individually signed, but the apt, dnf and apk repositories check signatures for you.
Sign in the first time
Open a terminal in a project folder and type claude. The first run opens your browser to sign in. Which account you use decides how you pay:
| Account | How usage is paid |
|---|---|
| Claude Pro or Max | Included in your subscription, within its usage limits |
| Claude Team or Enterprise | Through your organization’s plan |
| Anthropic Console | Pay as you go with API credits |
| Amazon Bedrock, Google Cloud, Microsoft Foundry | Through that cloud account |
A free Claude account can’t sign in to Claude Code. Our Claude AI guide compares the plans. If you have an ANTHROPIC_API_KEY environment variable set, Claude Code asks once whether to use that key instead of opening the browser.
Once you’re in, run /init. Claude Code reads the project and writes a CLAUDE.md file with its build commands and conventions, and it reads that file at the start of every session. A safe first request is “explain how this project is organized”, which changes nothing. For a first real project, building a small calculator site with AI is a good size, and writing clear prompts makes a bigger difference than any setting.
Native installer, Homebrew, WinGet or npm?
| Method | Command | Updates itself | Needs Node.js |
|---|---|---|---|
| Native installer (recommended) | See the first table | Yes, in the background | No |
| Homebrew (Mac) | brew install --cask claude-code |
No: brew upgrade claude-code |
No |
| WinGet (Windows) | winget install Anthropic.ClaudeCode |
No: winget upgrade Anthropic.ClaudeCode |
No |
| apt / dnf / apk (Linux) | Add Anthropic’s repository first | With system upgrades | No |
| npm | npm install -g @anthropic-ai/claude-code |
Yes, if the npm folder is writable | Node.js 22+ to install |
Older guides say npm needs Node.js 18. Anthropic’s docs now list Node.js 22 or later. Either way, the npm package only downloads the same native program, which doesn’t use Node when it runs. Never install it with sudo npm install -g. If npm throws EACCES permission errors, use the native installer instead.
Keeping it updated
Native installs check for updates when they start and install them in the background. The new version runs the next time you open Claude Code. To update right away, run claude update.
If you’d rather not get every release the day it ships, switch to the stable channel under /config → Auto-update channel. To install stable from the start, add stable to the install command:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash -s stable
# Windows PowerShell
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
Replace stable with a version number such as 2.1.89 to pin an exact release.
Other install errors and what they mean
| You see | What happened | What to do |
|---|---|---|
syntax error near unexpected token '<', < was unexpected at this time, or a 403 |
The download returned a web page instead of the script, usually from a proxy, firewall or unsupported region | Try another network, check your country is supported, then retry |
TLS connect error or SSL/TLS secure channel |
Old certificates, TLS 1.2 switched off in Windows PowerShell 5.1, or a corporate proxy inspecting traffic | On Windows, run [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 and install again in the same window. On Linux, update ca-certificates. Behind a proxy, ask IT for its certificate |
A parameter cannot be found that matches parameter name 'fsSL' |
The Mac/Linux command run in PowerShell | Use the PowerShell command |
The process cannot access the file ... being used by another process |
An earlier install attempt, or your antivirus scanning the half-downloaded file, is holding %USERPROFILE%\.claude\downloads |
Close other installer windows, run Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads", then install again |
Typing claude opens the desktop app |
An older Claude desktop app registered its own Claude.exe ahead of the CLI on your PATH |
Update the desktop app to the latest version |
exec: node: not found in WSL |
WSL is picking up the Windows copy of Node.js (an npm install) | Use the native installer in WSL, or install Node inside Linux |
File search or @file finds nothing |
The bundled ripgrep can’t run on your system | Install your system’s ripgrep and set USE_BUILTIN_RIPGREP=0 |
Anthropic keeps the full list of messages on its install troubleshooting page.
Uninstalling
Remove it the same way you installed it:
# Native install, macOS / Linux / WSL
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# Native install, Windows PowerShell
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
# Package managers
brew uninstall --cask claude-code
winget uninstall Anthropic.ClaudeCode
npm uninstall -g @anthropic-ai/claude-code
Your settings, permissions and session history stay in ~/.claude and ~/.claude.json. Delete those only if you want a completely clean start. The desktop app and the VS Code extension use the same folder and recreate it if they’re still installed.
Quick answers before you install
Is Claude Code free? Installing it is free; using it isn’t. You need a Pro, Max, Team, Enterprise or Console account.
Can I install it on Windows without WSL? Yes. The PowerShell installer runs natively on Windows 10 version 1809 and later and on Windows 11. WSL is optional.
How much disk space does it need? The Windows program I installed was about 285 MB. The native installer keeps a couple of recent versions for rollback, so leave room for more than one copy.
Is the desktop app the same thing? It runs Claude Code sessions through a graphical window and uses the same ~/.claude settings folder, but on my PC it didn’t give me a claude command in the terminal. If you want the terminal version, install it with the commands above. To see how it compares with Cursor, Copilot and the others, read our AI coding tools comparison.