The route Claude Code's official docs recommend is the native install, and for that you only need to paste one line into the terminal. Node.js isn't among the system requirements. You only need it if you install with npm. On Windows the command runs in PowerShell or CMD.
Before you start
You need a paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account you've loaded with credit in advance. The free claude.ai plan has no Claude Code access. Plans and prices are on the claude.com/pricing page.
Your computer needs at least 4 GB of RAM and an internet connection. Claude Code can only be used in the countries Anthropic supports.
The install command
You need macOS 13.0 or later. To open Terminal, open Spotlight with Cmd + Space, type Terminal and press Enter.
Paste this line into the window with Cmd + V and press Enter:
curl -fsSL https://claude.ai/install.sh | bash
The command shows no progress while it downloads, so leave the window open. When the install is done, the screen says Claude Code successfully installed!.
You need Windows 10 1809 or later. Windows has two programs you type commands into, PowerShell and CMD. They look alike, but their install commands are different.
To open PowerShell, press Win + X and pick Windows PowerShell or Terminal from the menu. In PowerShell every line starts with PS C:\. In CMD the PS at the start isn't there.
Paste this line into PowerShell with Ctrl + V or by right-clicking, and press Enter:
irm https://claude.ai/install.ps1 | iex
If you're in CMD, use this one instead:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
You don't need to run it as administrator. No progress shows while the download runs, so wait and don't close the window.
Git for Windows is optional, but the official docs recommend installing it. Claude Code's Bash tool uses the Git Bash that comes with it, and without Git for Windows the commands run through PowerShell. You don't need to learn Git for this.
When you install Git for Windows, press Next on every screen and accept the defaults. When it's done, close the terminal and open it again.
WSL is a separate route. Pick it if your projects live inside WSL or you work with Linux tools. Then run the command from the Linux tab in the WSL terminal. You open claude from there as well, and you don't need Git for Windows.
Ubuntu 20.04, Debian 10 and Alpine Linux 3.19 or later are supported. On most distributions the terminal opens with Ctrl + Alt + T.
The install command is the same as on the Mac. Paste it into the terminal with Ctrl + Shift + V and press Enter:
curl -fsSL https://claude.ai/install.sh | bash
For installing with a package manager (apt, dnf, apk) and the packages Alpine needs first, see the official setup page.
Check the install
When the install is done, open a new terminal window. The window you installed from stays open with the old PATH setting and may not find claude.
In the new window, type:
claude --version
If you see a version number like 2.1.211 (Claude Code), the install is done. If the terminal can't find claude, go to the Common errors section.
For a more detailed check, run:
claude doctor
This command writes out the state of the install and of the settings files without opening Claude Code. If a warning comes up, a suggested fix comes with it.
First launch and login
If you're going to work on a project, first go to that project's folder. Write your own folder's path in place of /path/to/your/project. Then type claude in the terminal and press Enter:
cd /path/to/your/project
claude
On first launch Claude Code asks you to log in and opens a window in the browser. Log in with your Claude account. Your details are saved and it won't ask again.
If the browser doesn't open by itself, press c in the terminal. The login address gets copied to the clipboard, so paste it into your browser.
You can't click with the mouse in the terminal, you move with the arrow keys. If you want to step in while Claude is working, press Esc. To leave, type exit, and /help shows the commands you can use.
Common errors
If the terminal says command not found: claude or 'claude' is not recognized, the install folder isn't in PATH. PATH is the list of folders where the terminal looks for programs.
First open a new window. If that doesn't fix it, run the command written under Setup notes at the end of the install, or take the one below that fits your system. You only need to make this fix once.
For Zsh, the default shell on the Mac:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
For Bash on Linux:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
On Windows, run the command in Setup notes, or open Environment Variables in the system settings and add the %USERPROFILE%\.local\bin folder to your user PATH. Then close the terminal and open it again.
On Windows, if you get 'irm' is not recognized, you're in CMD. Open PowerShell or use the CMD command. The error The token '&&' is not a valid statement separator means you pasted the CMD command into PowerShell, so switch to the PowerShell command.
The error 'bash' is not recognized or A parameter cannot be found that matches parameter name 'fsSL' comes up when you run the Mac and Linux command on Windows. Use the PowerShell command.
If the install stops with syntax error near unexpected token '<', or prints HTML like <!DOCTYPE html> to the screen, the address returned a web page instead of the install script. If the output says App unavailable in region, Claude Code isn't available in the country you're in.
If the only error on the screen is curl: (22) The requested URL returned error: 403, the cause may be the country restriction or a proxy on the company network.
If you're on a company network, a firewall may also be blocking the download. Proxy settings and network checks are on the official troubleshooting page.
If the address returned a web page or you got the 403 error, and the cause isn't the country restriction or a block on the company network, wait a few minutes and run the command again. If the error keeps coming back, install with Homebrew on the Mac:
brew install --cask claude-code
On Windows, with WinGet:
winget install Anthropic.ClaudeCode
On the Mac, the error dyld: cannot load or built for Mac OS X 13.0 most likely means your macOS version is too old. Look at About This Mac in the Apple menu, and if it's older than 13.0, update with Software Update.
If you see API Error: 403 Request not allowed after logging in, check on the claude.ai/settings page that your subscription is active. If you use Console, your account needs the Claude Code or Developer role, and the Console admin is the one who gives it.
If you'd rather install with npm
Claude Code's npm package installs the same native program. This route needs Node.js 22 or later.
npm install -g @anthropic-ai/claude-code
Don't put sudo in front of the command. It can lead to permission problems and security risks. If you installed with npm before and you're getting permission errors, switch to the native install command.
To update, use this command:
npm install -g @anthropic-ai/claude-code@latest
npm update -g may not move you to the latest version. Don't keep the native and npm installs side by side either. The versions can get mixed up.
Updating
The native install updates itself in the background. Claude Code looks for a new version when it opens and while it runs, and the version it downloads takes effect the next time it opens.
If you want to update without waiting, run:
claude update
claude doctor shows the result of the last update attempt. If you installed with Homebrew, WinGet or a Linux package manager, updates don't come on their own by default. With Homebrew and WinGet, run these commands every now and then:
brew upgrade claude-code
winget upgrade Anthropic.ClaudeCode
Sources
The commands and error messages were taken from these official pages:
If claude --version prints a version number, Claude Code is ready. In the 2-hour program you have Claude Code write a small web app and put it online. The program's starter template is already open on GitHub, and you can build your first app on it.