To install Claude Code, open a terminal and run curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. Then open a new terminal, check the install with claude --version and start it with claude. Installing costs nothing, but using Claude Code requires a paid Claude plan or a Claude Console account.
Part of our Claude AI guide. Commands were last checked on November 1, 2026 against Anthropic’s documentation. We also read the macOS and Linux install script line by line, but we did not run the installer for this guide.
Which install method should you use?
Anthropic recommends the native installer for most people. These are the options:
| Method | Good for | Updates |
|---|---|---|
| Native installer | Most people, on Mac, Windows, Linux and WSL | Automatic, in the background |
| Homebrew | People who manage their tools with brew | Manual by default |
| WinGet | People who manage Windows software with WinGet | Manual by default |
| apt, dnf or apk | Debian, Ubuntu, Fedora, RHEL and Alpine setups that use signed repositories | Manual by default |
| npm | People who already use Node.js 22 or later | Automatic, if the install did not need sudo |
| Desktop app | People who do not want to use a terminal | Not covered in the install docs we used |
What you need before you start
- Operating system: macOS 13.0 or later, Windows 10 1809 or later, Windows Server 2019 or later, Ubuntu 20.04 or later, Debian 10 or later, or Alpine Linux 3.19 or later.
- Hardware: at least 4 GB of RAM and an x64 or ARM64 processor.
- Connection and location: an internet connection, in a country Anthropic supports.
- Account: Claude Pro, Max, Ultra, Team or Enterprise, or a Claude Console account. The Free plan does not include Claude Code. See our Claude pricing guide for current prices.
You do not need Node.js for the native installer.
How to install Claude Code on Mac
- Open Terminal: press Cmd + Space, type Terminal and press Return.
- Paste this command and press Enter. It shows no progress while it downloads.
curl -fsSL https://claude.ai/install.sh | bash
- When it finishes, open a new Terminal window and check the install. A working install prints a version number followed by
(Claude Code).
claude --version
- Go to your project folder and start Claude Code. Replace the path with your own.
cd /path/to/your/project
claude
If you see zsh: command not found: claude, jump to the PATH fix.
Brew install Claude Code
Homebrew offers two casks. claude-code follows the stable channel, which is typically about a week behind, and claude-code@latest receives each new version as soon as it ships.
brew install --cask claude-code
Homebrew installs do not update themselves by default, so run brew upgrade claude-code from time to time, or brew upgrade claude-code@latest if you chose that cask.
How to install Claude Code on Windows
First check which shell you are in. PowerShell shows PS C:\ at the start of the line, and CMD shows C:\ without the PS. You do not need to run as Administrator.
In PowerShell:
irm https://claude.ai/install.ps1 | iex
In CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
With WinGet: this method does not update itself by default, so run winget upgrade Anthropic.ClaudeCode from time to time.
winget install Anthropic.ClaudeCode
Then open a new terminal and run claude --version, followed by claude in your project folder.
Two error messages mean you used the wrong command for your shell. 'irm' is not recognized means you are in CMD, and The token '&&' is not a valid statement separator means you are in PowerShell.
Do you need Git for Windows?
No, but Anthropic recommends it. With Git for Windows, Claude Code uses Git Bash for its Bash tool. Without it, Claude Code runs shell commands through PowerShell.
Native Windows or WSL?
You can run Claude Code on Windows itself or inside WSL. Choose by where your projects live. For WSL, open your distribution and run the Linux command inside the WSL terminal, not in PowerShell or CMD.
Use WSL 2 if you can. Only WSL 2 supports Claude Code’s sandboxing, and on WSL 1 Anthropic documents a known problem that shows up as cannot execute binary file: Exec format error. To convert a distribution, run wsl --set-version <DistroName> 2 in PowerShell.
How to install Claude Code on Linux and Ubuntu
Ubuntu, Debian and other Linux systems use the same command as the Mac. Do not put sudo in front of it. The script stops with an error if it is run through sudo from a normal user account, because Claude Code installs into your home directory.
curl -fsSL https://claude.ai/install.sh | bash
- Minimal systems: a fresh Debian or Ubuntu install may not include
curl, so install it first if the command is missing. - Small servers: if the install ends with
Killed, the system probably ran out of memory. The install step needs roughly 512 MB free, so free up memory or add swap space and run it again. - Alpine and other musl-based systems: install the required packages first with
apk add bash curl libgcc libstdc++ ripgrep, then setUSE_BUILTIN_RIPGREPto0in your settings. - Package managers: Anthropic publishes signed apt, dnf and apk repositories. The setup steps differ by system, so follow Anthropic’s instructions.
npm install Claude Code
The npm package installs the same native binary as the standalone installer. Anthropic specifies Node.js 22 or later, although on an older version npm only prints an EBADENGINE warning and the install completes. Do not use sudo, which can cause permission and security problems and stops automatic updates from working.
npm install -g @anthropic-ai/claude-code
To upgrade, run the same command with @latest at the end of the package name. If npm --version starts with 12, follow Anthropic’s npm 12 fix instead.
Install Claude Code in VS Code, JetBrains or the desktop app
- Desktop app: Anthropic offers a desktop app that lets you use Claude Code through a graphical interface, without a terminal.
- VS Code: you need version 1.94.0 or later. Search for “Claude Code” in the Extensions view and install it. The extension carries its own private copy of the program and does not add
claudeto your PATH, so typingclaudein a terminal still needs a separate install. - Cursor: the same extension installs there. See Claude Code vs Cursor for how the two work together.
- JetBrains IDEs: install the command-line tool first, then the Claude Code plugin from the JetBrains Marketplace. The plugin runs
claudein the IDE’s terminal and does not include its own copy.
How to sign in
Claude Code asks you to log in the first time you run claude. Follow the prompts, which finish in your browser. You can use a Claude subscription or a Claude Console account with prepaid API credits. Claude Code also works through Amazon Bedrock, Google Cloud’s Agent Platform and Microsoft Foundry. Your credentials are then stored, and you can switch accounts later with /login.
Check for an API key first. If the ANTHROPIC_API_KEY environment variable is set and you approve it, Claude Code skips the login and bills the API instead of your subscription. An old key can also cause API Error: 400 ... This organization has been disabled. On Mac and Linux, run unset ANTHROPIC_API_KEY and remove any matching export line from your shell’s config file. Inside Claude Code, /status shows which sign-in method is active.
Fix “command not found: claude”
This is a common error after installing. It usually means the install worked but its folder is not on your PATH. The wording depends on your system:
- macOS:
zsh: command not found: claude - Linux:
bash: claude: command not found - Windows CMD:
'claude' is not recognized as an internal or external command - PowerShell:
The term 'claude' is not recognized
First open a new terminal, because a window that was already open keeps its old PATH. If the error stays, follow these steps.
On Mac and Linux
Check that the program exists. If this reports No such file or directory, the native install did not finish, or you installed another way.
ls -la ~/.local/bin/claude
Next, check whether its folder is already on your PATH. If this prints the folder, skip the next step and look for a second install.
echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"
If it prints nothing, add the folder to your PATH. For Zsh, the default on macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
For Bash on Linux, use ~/.bashrc in both lines. For Bash on macOS, use ~/.bash_profile.
On Windows PowerShell
Check that the program exists. False means there is no native install.
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
Next, check whether its folder is already on your PATH:
$env:PATH -split ';' | Select-String '\.local\\bin'
If there is no output, add the folder to your user PATH and restart the terminal:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
A terminal inside an editor takes its PATH from the editor, so quit and reopen the editor as well.
On Windows CMD
Check that the program exists:
dir "%USERPROFILE%\.local\bin\claude.exe"
If it does, open System Settings, go to Environment Variables, add %USERPROFILE%\.local\bin to your User PATH variable and restart the terminal.
Other install errors
| What you see | What it means |
|---|---|
syntax error near unexpected token '<' |
The command downloaded a web page instead of the script. Anthropic’s page below lists fixes, including installing through Homebrew or WinGet instead. |
curl: (22) ... error: 403 |
Often the same cause, but it can also come from a corporate proxy or firewall. |
Native installation exists but ... is not in your PATH |
The install worked. Use the PATH fix above. |
Killed on Linux |
The system usually ran out of memory during the install. |
App unavailable in region |
Claude Code is not available in your country. |
Cask 'claude-code' is unavailable |
Your Homebrew needs updating. |
Claude Code does not support 32-bit Windows |
You may have opened Windows PowerShell (x86). Open the entry without (x86) and try again. |
running scripts is disabled on this system |
This affects npm on Windows. PowerShell’s execution policy is blocking npm’s launcher scripts. The PowerShell installer is not affected, so you can switch to it. |
If claude runs an old version, you may have a second install. which -a claude on Mac or Linux lists every copy on your PATH. Anthropic’s install troubleshooting page lists many more errors with fixes, and claude doctor prints a read-only check of your install.
What the install script actually does
Piping a script from the internet into Bash deserves a look. We read the current macOS and Linux script on November 1, 2026. Scripts can change, so this describes that version:
- It stops if it is run through
sudofrom a normal user account. - It detects your system and processor, including Apple Silicon under Rosetta and musl-based Linux.
- It asks
downloads.claude.aifor the latest version and a manifest with checksums. - It downloads the program to
~/.claude/downloadsand stops if the SHA-256 checksum does not match. - It runs the downloaded program’s own
installcommand to set up the launcher and shell integration, then deletes the download.
Because step 5 hands over to the downloaded program, reading the script does not show everything that the install changes. To read the script before you run it, download it and open it in a viewer. Press q to leave the viewer.
curl -fsSL https://claude.ai/install.sh -o install.sh
less install.sh
Then run it:
bash install.sh
Anthropic also signs each release manifest with a GPG key, and it documents how to verify the signature.
Update, change version or uninstall
Update now: native installs update in the background, and you can force it with claude update.
Install the stable channel: it is typically about a week old and skips releases with major regressions. A channel chosen at install time becomes your default for updates. On Mac, Linux and WSL:
curl -fsSL https://claude.ai/install.sh | bash -s stable
In Windows PowerShell:
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
In Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd
Uninstall a native install on Mac, Linux or WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Uninstall on Windows PowerShell:
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
Uninstall other installs: use brew uninstall --cask claude-code (or claude-code@latest), winget uninstall Anthropic.ClaudeCode or npm uninstall -g @anthropic-ai/claude-code. For apt, dnf and apk, follow Anthropic’s steps.
These commands remove only the program. Deleting ~/.claude and ~/.claude.json also removes your settings, allowed tools, MCP configuration and session history, so only do that if you want a completely clean start. If the VS Code extension, JetBrains plugin or desktop app is still installed, the folder comes back the next time it runs.
Install Claude Code FAQ
Is Claude Code free to install?
Installing is free, but using it is not. Claude Code requires Pro, Max, Ultra, Team, Enterprise or a Console account, and Claude’s Free plan does not include it. Pro costs $20 per month, or $17 with annual billing.
Do I need Node.js to install Claude Code?
Only for the npm method, where Anthropic specifies Node.js 22 or later. The native installer does not use it.
Should I use the native installer or npm?
Anthropic recommends the native installer. Both install the same binary, so npm mainly makes sense if you already manage your tools with it.
Why does the install show nothing while it runs?
Anthropic notes that the install command shows no progress during the download. Give it time before you assume that it has failed.
Can I install a specific version?
Yes. The native installer accepts a version number, stable or latest, in the same position as the stable commands above.
What should I do after installing?
Run claude in a project and ask it to explain the code. Then add a CLAUDE.md with your project’s conventions, and read our guides to Claude Skills and Claude Code workflows.
Sources
- Claude Code docs: Advanced setup
- Claude Code docs: Quickstart
- Claude Code docs: Troubleshoot installation and login
- Claude Code docs: VS Code, JetBrains, Desktop app
- Anthropic’s install script for macOS and Linux
- Claude plans and pricing





