Install Claude Code (2026): 3 Commands for macOS, Windows & Linux in Under 2 Minutes

One curl command on macOS/Linux, one PowerShell command on Windows. All 6 install methods compared (native, Homebrew, WinGet, npm, apt, desktop app), plus verification, auth, and uninstall.

June 9, 2026 ยท 1 min read
Install Claude Code (2026): 3 Commands for macOS, Windows & Linux in Under 2 Minutes

Installing Claude Code takes one command and under two minutes. The confusion is that there are six ways to do it, and they differ in what they require and how updates work. This page covers all six, exact commands first, tradeoffs second.

1
Command per OS
6
Install methods
0
Dependencies (native)
4 GB
Minimum RAM

The 3 Commands

Anthropic's recommended method is the native installer. It needs no Node.js and auto-updates in the background.

macOS, Linux, and 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

Then verify and start:

Verify and launch

claude --version   # confirm the binary is on your PATH
cd your-project
claude             # first launch opens browser auth

Is Claude Code Free to Install?

Installing is free. Using it is not. Claude Code requires one of: a Claude Pro plan ($17/month billed annually, $20 monthly), Max 5x ($100/month), Max 20x ($200/month), Team ($20/seat/month annual standard), Enterprise, or an Anthropic Console account billed per token at API rates. Anthropic's setup docs state it directly: the free Claude.ai plan does not include Claude Code access.

Claude Code also works through Amazon Bedrock, Google Vertex AI, and Microsoft Foundry if your organization already buys Claude there. Full plan breakdown on our Claude Code pricing page; session and weekly caps on Claude Code usage limits.

System Requirements

  • macOS: 13.0 or newer
  • Windows: 10 version 1809+ or Server 2019+
  • Linux: Ubuntu 20.04+, Debian 10+, or Alpine 3.19+
  • Hardware: 4 GB+ RAM, x64 or ARM64
  • Shell: Bash, Zsh, PowerShell, or CMD
  • Node.js 18+: only for the npm install method

Alpine and other musl-based distros additionally need libgcc, libstdc++, and ripgrep, with USE_BUILTIN_RIPGREP=0 set.

All 6 Install Methods Compared

MethodCommandRequiresUpdates
Native (recommended)curl -fsSL https://claude.ai/install.sh | bashNothingAuto-updates in background
Windows PowerShellirm https://claude.ai/install.ps1 | iexNothingAuto-updates in background
Homebrewbrew install --cask claude-codeHomebrewManual: brew upgrade claude-code
WinGetwinget install Anthropic.ClaudeCodeWinGetManual: winget upgrade Anthropic.ClaudeCode
npmnpm install -g @anthropic-ai/claude-codeNode.js 18+Manual: npm install -g @anthropic-ai/claude-code@latest
apt / dnf / apksudo apt install claude-code (after adding repo)Signed repo at downloads.claude.aiVia package manager

There is also a Desktop app (graphical, no terminal) for macOS and Windows at claude.com/download, plus a VS Code extension and JetBrains plugin. The CLI underpins all of them.

The update mechanism is the real difference

Every method installs the same native binary. The native installer and PowerShell script auto-update in the background; Homebrew (which also lags stable by about a week), WinGet, and npm all require manual upgrades. If you do not want to think about versions, use the native installer.

Install Claude Code on macOS and Linux (curl)

Native installer

curl -fsSL https://claude.ai/install.sh | bash

This installs the binary to ~/.local/bin/claude and adds it to your PATH. Open a new terminal window afterward so your shell picks up the PATH change, then run claude --version.

Works identically inside WSL. No sudo, no Node.js, no package manager.

irm https://claude.ai/install.ps1 | iex (Windows)

That PowerShell one-liner is the entire Windows install. irm (Invoke-RestMethod) downloads the install script, iex (Invoke-Expression) runs it:

Windows PowerShell install

irm https://claude.ai/install.ps1 | iex

From CMD instead:

Windows CMD install

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Or via WinGet:

WinGet install

winget install Anthropic.ClaudeCode

Windows specifics worth knowing:

  • No admin rights needed. Native Windows installs run as a regular user.
  • Git for Windows is optional but enables the Bash tool. Without it, Claude Code uses the PowerShell tool. If Git Bash is installed but not found, set CLAUDE_CODE_GIT_BASH_PATH (e.g. C:\Program Files\Git\bin\bash.exe) in your settings env.
  • Sandboxing: WSL2 is supported; native Windows and WSL1 are not.

WSL Install

Windows via WSL

# In PowerShell (admin), then reboot:
wsl --install

# Inside your WSL terminal:
curl -fsSL https://claude.ai/install.sh | bash

Common WSL mistake: installing via npm with Node.js present on the Windows side but not inside WSL. Each environment needs its own install. The native curl method inside WSL sidesteps this entirely.

Install Claude Code on Ubuntu, Debian, Fedora, and Alpine

Beyond the curl installer, Anthropic publishes signed apt, dnf, and apk repositories at downloads.claude.ai. For Ubuntu and Debian:

Ubuntu / Debian (apt)

# Add Anthropic's signing key
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

# Add the stable repository
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

# Upgrade later with:
# sudo apt update && sudo apt upgrade claude-code

Fedora/RHEL use a dnf repo with baseurl https://downloads.claude.ai/claude-code/rpm/stable; Alpine uses the apk repo at https://downloads.claude.ai/claude-code/apk/stable. The GPG key fingerprint is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE, so you can verify what you are trusting.

More distro detail on our Claude Code on Linux page.

Brew Install Claude Code (macOS)

Homebrew install

brew install --cask claude-code

# Or track the newest release instead of stable:
brew install --cask claude-code@latest

Two caveats. The default cask follows the stable channel, about one week behind the latest release. And Homebrew installs do not auto-update:

Update via Homebrew

brew upgrade claude-code

npm install -g @anthropic-ai/claude-code

npm install

npm install -g @anthropic-ai/claude-code

Requires Node.js 18+. The package ships the same native binary through per-platform optional dependencies like @anthropic-ai/claude-code-darwin-arm64; the installed claude binary never invokes Node. So npm is a delivery mechanism, not a runtime dependency. Use it when npm is already your standard tooling or you pin versions in lockstep with a team. Full npm walkthrough: npm install claude code.

Upgrade explicitly, not with npm update -g:

Update via npm

npm install -g @anthropic-ai/claude-code@latest

Never sudo npm install -g

Anthropic's docs say it flat: never use sudo with npm install. Root-owned files in your npm directory cause permission failures on every future global install. If you hit EACCES, change npm's prefix to a user-owned directory or use nvm.

Verify the Install

Three checks

claude --version   # binary found and on PATH
claude doctor      # detailed config check: install type, auth, settings
claude update      # apply any pending update immediately

If claude --version prints a version, the install worked. claude doctor is the first thing to run when anything misbehaves later; it diagnoses installation type, auth state, and configuration issues.

Authentication: Subscription vs API Key

Run claude in a project directory. First launch opens your browser to authenticate. Two paths:

OptionPriceWhat You Get
Claude Free$0No Claude Code access
Claude Pro$17/mo annual, $20 monthlyClaude Code + Claude chat, shared 5-hour session limits
Max 5x$100/mo5x Pro usage per session, weekly limits across models
Max 20x$200/mo20x Pro usage per session
Team$20/seat/mo annual ($25 monthly)Includes Claude Code; premium seats $100/$125
Console / API keyPer token (Sonnet 4.6: $3 in / $15 out per MTok)Pay for exactly what you use, no session caps

Subscription auth signs in with your Claude.ai account; usage draws from your plan's five-hour session limit plus weekly caps, shared with Claude chat. Console auth bills per token: Opus 4.6 at $5/$25 per million tokens, Sonnet 4.6 at $3/$15, Haiku 4.5 at $1/$5. For headless and CI environments, set ANTHROPIC_API_KEY instead of browser auth.

Enterprise setups can route through Amazon Bedrock (CLAUDE_CODE_USE_BEDROCK=1), Google Vertex AI (CLAUDE_CODE_USE_VERTEX=1), or an LLM gateway; see Claude Code with LiteLLM.

Agent SDK credit (from June 15, 2026)

Non-interactive usage (claude -p, Agent SDK, GitHub Actions) on subscription plans draws from a separate monthly Agent SDK credit: $20 on Pro, $100 on Max 5x, $200 on Max 20x. Interactive terminal sessions are unaffected.

Pin a Version, Control Updates

Install a specific version or channel

# Exact version
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89

# Stable channel (about a week behind latest)
curl -fsSL https://claude.ai/install.sh | bash -s stable

# Windows PowerShell, stable channel
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable

Control the update channel in settings.json:

settings.json update controls

{
  "autoUpdatesChannel": "stable"
}

autoUpdatesChannel defaults to latest. Set the env var DISABLE_AUTOUPDATER=1 to stop background updates, or DISABLE_UPDATES to block every update path. Teams can enforce a floor with minimumVersion.

Uninstall Claude Code

Remove a native install

# Remove the binary and shared files
rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude

# Optionally remove all settings, MCP config, and session history
rm -rf ~/.claude && rm ~/.claude.json

Homebrew, WinGet, npm, and apt installs uninstall through their respective package managers. The second command deletes your configuration permanently; skip it if you plan to reinstall.

Troubleshooting

claude: command not found

The native installer puts the binary at ~/.local/bin/claude. Open a new terminal first. Still missing? Check that ~/.local/bin is on your PATH; this is the most common failure on Ubuntu and WSL:

Fix PATH (bash/zsh)

# Check where (or whether) claude resolves
which claude
ls ~/.local/bin/claude

# If the binary exists but isn't found, add it to PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc   # or ~/.zshrc
source ~/.bashrc

EACCES errors with npm

Do not reach for sudo. Point npm's global prefix at a directory you own, or use nvm:

Fix npm global permissions

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
npm install -g @anthropic-ai/claude-code

Authentication fails

  • Confirm your account is Pro, Max, Team, Enterprise, or Console. The free plan is rejected.
  • Make sure the browser that opens is logged into the same Claude account.
  • Run claude logout, then claude to retry.
  • In CI or on servers, set ANTHROPIC_API_KEY instead.

Alpine: binary runs but tools fail

musl-based distros need libgcc, libstdc++, and system ripgrep, plus USE_BUILTIN_RIPGREP=0.

Everything else

claude doctor diagnoses install type, auth, and config issues automatically. Run it before debugging by hand.

After Install: Generate a CLAUDE.md

The highest-impact post-install step takes one command. Inside Claude Code, run /init. It analyzes your codebase and generates a starter CLAUDE.md: build commands, conventions, and architecture notes that load into every session. Anthropic's guidance is to keep it under 200 lines and make every instruction verifiable ("Run npm test before committing", not "test thoroughly").

One command

/init

Structure and examples: CLAUDE.md guide and CLAUDE.md examples. From there, the usual extension points are MCP servers, hooks, and settings.json permissions.

CLAUDE.md

Persistent project context loaded every session. Run /init once, then keep it under 200 lines of verifiable instructions.

MCP servers

Connect GitHub, databases, and search tools. claude mcp add registers a server; claude mcp list shows what's configured.

Hooks

Shell commands that fire on lifecycle events: format after edits, block dangerous commands, inject context at session start.

Frequently Asked Questions

Can I install Claude Code for free?

Installing costs nothing. Using it requires a paid plan: Pro ($17/mo annual, $20 monthly), Max ($100-200/mo), Team, Enterprise, or a Console account billed at API rates. The free Claude.ai plan does not include Claude Code.

Do I need to install Claude Code to use Claude for coding?

No. Claude Code also ships as a Desktop app for macOS and Windows (graphical, no terminal), a VS Code extension, and a JetBrains plugin. The CLI is the most capable surface, but the desktop app needs no terminal at all.

Does Claude Code require Node.js?

Only the npm install method, and only at install time (Node.js 18+). The package delivers a native binary via platform-specific optional dependencies; the claude command never invokes Node. Native, Homebrew, WinGet, and apt installs skip Node entirely.

What is the difference between the curl installer and npm?

Same binary, different update behavior. The native curl/PowerShell install auto-updates in the background. The npm install updates only when you run npm install -g @anthropic-ai/claude-code@latest.

Can I use Claude Code on Windows without WSL?

Yes. irm https://claude.ai/install.ps1 | iex installs natively, no admin rights required. Install Git for Windows if you want Claude to use Bash instead of PowerShell. The one feature gap: sandboxing requires WSL2.

How do I update Claude Code?

claude update applies updates immediately on any install. Native installs also auto-update in the background. Homebrew: brew upgrade claude-code. WinGet: winget upgrade Anthropic.ClaudeCode. npm: reinstall with @latest (avoid npm update -g).

How do I install an older or pinned version?

curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89 installs that exact version. bash -s stable tracks the stable channel. Set {"autoUpdatesChannel": "stable"} in settings.json to stay there.

Is the claude CLI the same thing as Claude Code?

Yes. claude is the command the Claude Code install provides. Run it bare for the interactive REPL, or claude -p "prompt" for non-interactive scripted use.

Make Claude Code Faster with Morph

Morph builds MCP servers that plug into Claude Code. WarpGrep gives Claude RL-trained code search in its own context window (free for 100k requests, $1/1M after). Fast Apply merges file edits at 10,500 tok/s.