Updated October 31, 2026 · commands checked against Anthropic’s docs
Every way to install Claude Code in 2026, the one command most people need, and how to check it worked.
The short version: On a Mac, Linux or WSL, open a terminal and run curl -fsSL https://claude.ai/install.sh | bash. On Windows, use irm https://claude.ai/install.ps1 | iex in PowerShell. Open a new terminal, run claude in a project folder and log in through your browser. You need a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or an Claude Console account; the free plan doesn’t include Claude Code. Rather not use a terminal? The Claude desktop app runs Claude Code too.
What is the fastest way to install Claude Code?
One line in your terminal. Pick your system, paste the command, press Enter. The installer shows no progress bar while it downloads, so give it a minute.
| Your system | Run this in a terminal |
|---|---|
| macOS, Linux, WSL | curl -fsSL https://claude.ai/install.sh | bash |
| Windows PowerShell | irm https://claude.ai/install.ps1 | iex |
| Windows CMD | curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd |
| Homebrew (Mac) | brew install --cask claude-code |
| WinGet (Windows) | winget install Anthropic.ClaudeCode |
| npm (Node.js 22+) | npm install -g @anthropic-ai/claude-code |
When it finishes, open a new terminal window, go to a project folder (any folder with files you want Claude to work on) and run claude. The first time, it opens your browser to log in. The one-line installer keeps Claude Code updated in the background; Homebrew, WinGet and Linux package installs don’t by default (Anthropic setup docs).

No terminal? The Claude desktop app for Mac, Windows and Linux runs Claude Code in a normal window, so you can skip everything below (download Claude). New to the idea? Start with what Claude Code is.
What do you need before installing Claude Code?
The free Claude plan does not include Claude Code. The cheapest way in is Claude Pro, $20 a month or $17 a month billed yearly (Claude pricing); see our Claude Code pricing guide for the bigger plans. Companies can also connect through Amazon Bedrock, Google Cloud or Microsoft Foundry. All of this comes from Anthropic’s system requirements (Anthropic).
How do you install Claude Code on macOS?
Option 1: the one-line installer (recommended). Open the Terminal app (press Command+Space and type “Terminal”) and run:
curl -fsSL https://claude.ai/install.sh | bash
It puts a small claude launcher in ~/.local/bin (the ~ stands for your home folder), which points to the main program in ~/.local/share/claude/versions/. It updates itself in the background. On our Mac that version folder takes about 263 MB.
Option 2: Homebrew. If you already use Homebrew, a free tool for installing apps on a Mac from the terminal:
brew install --cask claude-code
This version follows the stable channel, which usually runs about a week behind and skips releases with big problems. If you want every release, install claude-code@latest instead. Homebrew installs don’t update themselves: run brew upgrade claude-code now and then.
How do you install Claude Code on Windows?
You don’t need to run as Administrator. To tell which window you have open, look at the start of the line where you type: PowerShell shows PS C:\ and CMD shows plain C:\. Use the command that matches.
PowerShell (recommended):
irm https://claude.ai/install.ps1 | iex
CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
WinGet:
winget install Anthropic.ClaudeCode
WinGet won’t fetch new versions for you, so run winget upgrade Anthropic.ClaudeCode every so often. Git for Windows is optional: with it, Claude Code can use Git Bash for commands; without it, Claude Code uses PowerShell instead (Anthropic).
How do you install Claude Code on Linux?
Option 1: the one-line installer (recommended), the same as on a Mac:
curl -fsSL https://claude.ai/install.sh | bash
Option 2: your system’s package manager, the built-in tool Linux uses to install software. Anthropic publishes signed apt (Debian, Ubuntu), dnf (Fedora, RHEL) and apk (Alpine) repositories, each with a stable and a latest channel. Adding the repository takes a few commands, including checking the signing key, so copy them from Anthropic’s setup page. Package installs update with your normal system updates. On Alpine, first install bash, curl, libgcc, libstdc++ and ripgrep (from the community repository), then set USE_BUILTIN_RIPGREP to 0 in Claude Code’s settings file.
How do you install Claude Code in WSL (Windows Subsystem for Linux)?
Open the Linux system you installed in WSL (such as Ubuntu) and run the Linux installer there, not in PowerShell:
curl -fsSL https://claude.ai/install.sh | bash
WSL doesn’t need Git for Windows. Choose WSL 2 if your projects use Linux tools, or if you want Claude Code’s sandboxing, which fences off the commands it runs from the rest of your computer. Regular Windows doesn’t support it. Your Windows files are reachable from WSL under /mnt/c/.
How do you log in to Claude Code on first run?
cd /path/to/your/project
claude
The first line moves your terminal into your project folder (swap in your own folder’s path), and the second starts Claude Code. Your browser opens; log in with your Claude account and click to approve. Then go back to the terminal and you are in. You can sign in with:
- A Claude subscription (Pro, Max, Ultra, Team or Enterprise): the simplest choice for most people.
- An Claude Console account: pay as you go for what you use.
- A cloud provider (Amazon Bedrock, Google Cloud or Microsoft Foundry): for companies that already pay for AI that way.
You stay logged in on that computer until the login expires; Claude Code warns you three days ahead. Type /login inside Claude Code to switch accounts (Anthropic authentication docs).
How do you authenticate with an API key instead of subscription?
Create a key in the Claude Console under API Keys, then save it as an environment variable (a named setting your terminal hands to programs) before you run claude. Claude Code asks once whether to use it.
export ANTHROPIC_API_KEY=sk-ant-...
$env:ANTHROPIC_API_KEY = "sk-ant-..."
To keep it between sessions, add the line to the file your terminal reads every time it opens (~/.zshrc or ~/.bashrc), or on Windows add it in the Environment Variables settings. A key suits scripts, servers and pay-per-use billing; for everyday use on your own computer, logging in with a subscription is simpler. Subscribers who need a login for a script can run claude setup-token to create a long-lived token, a saved login code the script can use in place of a browser sign-in.
How do you set up Claude Code with AWS Bedrock, Vertex AI, or Microsoft Foundry?
Companies that buy AI from a cloud provider can connect Claude Code to that account, so usage appears on the same cloud bill. On Amazon Bedrock, set CLAUDE_CODE_USE_BEDROCK=1 and your usual AWS credentials. Google Cloud (Vertex AI, which Anthropic’s docs now call Google Cloud’s Agent Platform) and Microsoft Foundry have their own settings. The exact variables change occasionally, so follow Anthropic’s authentication page for your provider.
How do you verify the install worked?
claude --version
claude doctor

A working install prints a version number such as 2.1.312 (Claude Code). claude doctor then checks the install without starting a session: on our Mac it reported a native install (the one-line installer’s type), auto-updates on, the last update successful and “No installation issues found.” For a final test, open a project folder, run claude and ask “What does this project do?” Anthropic’s quickstart has good first tasks.
What are the most common install errors and how do you fix them?
- “The token ‘&&’ is not a valid statement separator.” You are in PowerShell but used the CMD command. Use
irm https://claude.ai/install.ps1 | iex. - “‘irm’ is not recognized.” You are in CMD but used the PowerShell command. Use the CMD line instead.
- “command not found: claude” after installing. Open a new terminal window first. If it still fails, the install folder (
~/.local/binon Mac and Linux) isn’t on your PATH yet. PATH is the list of folders your terminal searches for programs, and Anthropic’s install troubleshooting page shows how to add it. - “syntax error near unexpected token ‘<’” or a 403 error. The download returned a web page or an error instead of the installer. If it mentions “App unavailable in region,” Claude Code isn’t offered in your country. Otherwise it is usually a work proxy or firewall, or a short outage: try another network. The other install methods use the same servers, so switching method alone rarely helps.
- Login keeps failing. Type
/logininside Claude Code to sign in again, and check that your plan includes Claude Code (the free plan does not).
Anthropic keeps a fuller list on its troubleshooting page.
How do you update Claude Code to the latest version?
- One-line installer: updates on its own in the background. To update right now, run
claude update. - Homebrew:
brew upgrade claude-code(orclaude-code@latest). - WinGet:
winget upgrade Anthropic.ClaudeCode. - apt, dnf, apk: your normal system update.
- npm:
npm install -g @anthropic-ai/claude-code@latest.
Prefer slower, safer updates? With the one-line installer, switch to the stable channel in Claude Code’s /config menu (Auto-update channel). Homebrew picks the channel by cask name, and apt, dnf and apk by repository.
How do you uninstall Claude Code?
Remove it the same way you installed it. For the one-line installer on Mac, Linux or WSL:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
- Homebrew:
brew uninstall --cask claude-code(orclaude-code@latest) - WinGet:
winget uninstall Anthropic.ClaudeCode - apt:
sudo apt remove claude-code, then delete its repository file and signing key (sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc) - npm:
npm uninstall -g @anthropic-ai/claude-code
Your settings and history stay in ~/.claude and ~/.claude.json; delete them to remove everything. The desktop app and editor plugins use the same folder, so only delete it after you’ve removed those too. Uninstalling doesn’t cancel your Claude plan; do that separately in your account settings.
Frequently asked questions
Does Claude Code work on Apple Silicon Macs?
Yes. The installer picks the right version for M-series Macs automatically; on ours it shows up as darwin-arm64, the Apple silicon build.
Does Claude Code work on ARM Linux, such as a Raspberry Pi?
64-bit ARM (ARM64) is supported, with 4 GB of RAM or more. 32-bit systems are not.
Do I need admin rights?
Not for the one-line installer, which installs into your own user folder. System package managers such as apt and dnf need sudo, which runs a command with admin rights and asks for your password.
Does Claude Code need Node.js or Python?
No. The one-line installer brings everything it needs. Only the npm install method needs Node.js, version 22 or later.
How much disk space does it use?
Our Mac install takes about 263 MB, plus whatever history and settings build up in ~/.claude.
Can I use one subscription on several computers?
Yes. Install it on each computer and log in with the same account; they all share your plan’s usage limits.
Can I run it in Docker or a cloud dev environment?
Yes. Use an API key, or a token from claude setup-token saved as CLAUDE_CODE_OAUTH_TOKEN, so the container doesn’t need a browser login every time it starts.
Can I install a specific version?
Yes. Add a version number or channel to the installer, for example curl -fsSL https://claude.ai/install.sh | bash -s stable.
Where does Claude Code store my settings and history?
In the .claude folder in your home directory and the ~/.claude.json file, plus a .claude folder inside each project where you add project settings.
Does it work offline?
No. Claude Code needs an internet connection to reach Anthropic’s models.
What comes after the install?
- Read our Claude Code beginner’s guide for your first real task.
- Add a CLAUDE.md file to your project to tell Claude Code your rules and habits; our advanced workflows guide shows patterns that work.
- Comparing tools? See Codex vs Claude Code. In the news: Microsoft canceling Claude Code licenses (May 2026).
Made for regular people, by a real person
One AI story, tool or tip a day, including what just changed in Claude Code. Curated and edited by a human.
Free forever. Unsubscribe anytime.
You May Also Like
- What Is Claude Code?
- Claude Code Beginner’s Guide
- Claude Code Pricing
- Claude Code Advanced Workflows
- Codex vs Claude Code
- What Is CLAUDE.md?
- Claude Cowork
- How to Use Claude AI
Sources
- Claude Code setup, quickstart, authentication, troubleshooting and CLI reference (Anthropic, read October 31, 2026).
- Claude pricing and Claude Code product page (Anthropic).
- Git for Windows.
- Beginners in AI install check on a Mac (Apple silicon), October 31, 2026.
Last reviewed: October 31, 2026. Claude Code updates often; if a command changes, Anthropic’s setup page has the current version.

