How to install Claude Code on Mac and Windows (and Linux)

Decision chart for installing Claude Code, checked 29 October 2026. Mac: native installer first, then Homebrew, then npm. Windows: PowerShell installer first, then Command Prompt, then WinGet or WSL 2. Linux: native installer first, then apt, dnf or apk, and check memory on small servers

Claude Code installation takes one command: on a Mac, Linux or WSL run curl -fsSL https://claude.ai/install.sh | bash, and in Windows PowerShell run irm https://claude.ai/install.ps1 | iex. Then type claude in your project folder and sign in with a paid Claude plan, from £18 a month in the UK, or an API key. The latest version is 2.1.312.

Key facts

  • Quickest install: Anthropic's native installer, one command, recommended by Anthropic and updates itself in the background.
  • Runs on: macOS 13.0+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+ and Alpine 3.19+, with 4 GB of RAM.
  • Other official routes: Homebrew, WinGet, apt, dnf, apk and npm (Node.js 22+).
  • Account needed: Pro, Max, Team, Enterprise or a Console (API) account; not the free plan.
  • Cheapest UK plan: Claude Pro at £18 a month or £180 a year, including VAT, as of 29 October 2026.
  • Latest version: 2.1.312, released 27 October 2026; stable channel 2.1.308.
  • Most common error: command not found: claude: open a new terminal, then fix your PATH.

On this page

What do you need before installing Claude Code?

You need a supported operating system, 4 GB of RAM, an internet connection and a paid Claude account. Node.js is no longer required for the recommended installer.

Anthropic's Advanced setup page lists the requirements as of 29 October 2026:

  • Operating system: macOS 13.0 or later; Windows 10 version 1809 or later, or Windows Server 2019 or later; Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+.
  • Hardware: 4 GB of RAM or more, and an x64 or ARM64 processor. 32-bit Windows is not supported.
  • Network: an internet connection. The installer downloads from downloads.claude.ai.
  • Location: one of Anthropic's supported countries. The United Kingdom is on the list.

Prefer no terminal? The Claude desktop app has Claude Code in its Code tab. My Claude Code guide explains what the tool does; this page covers getting it installed and working.

Which Claude Code installation method should you use?

Use the native installer unless you have a reason not to. It is the only method Anthropic labels "Recommended", and it keeps itself up to date without extra settings.

Decision chart for installing Claude Code, checked 29 October 2026. Mac: native installer first, then Homebrew, then npm. Windows: PowerShell installer first, then Command Prompt, then WinGet or WSL 2. Linux: native installer first, then apt, dnf or apk, and check memory on small servers
Which Claude Code install method to use, from Anthropic's setup and troubleshooting docs, checked 29 October 2026. Graphic: aiagents.org.uk
MethodWorks onUpdates itself?Release channel
Native installer (recommended)Mac, Linux, WSL, WindowsYes, in the backgroundLatest by default; stable on request
HomebrewMac with HomebrewNo: run brew upgrade claude-codeclaude-code is stable; claude-code@latest is latest
WinGetWindowsNo: run winget upgrade Anthropic.ClaudeCodeNot stated
apt, dnf, apkDebian, Ubuntu, Fedora, RHEL, AlpineNo: updates come with system upgradesStable or latest, chosen by repository
npmAny supported platform with Node.js 22+Yes, if npm's global folder is writableNot stated

Claude Code install methods compared, from code.claude.com/docs/en/setup, 29 October 2026. Homebrew and WinGet can update automatically if you set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE to 1.

How do you install Claude Code on a Mac?

Open Terminal, paste Anthropic's one-line installer, press Return, then open a new Terminal window and type claude. The whole job takes one command.

  1. Open Terminal (Cmd and Space, type Terminal, press Return).
  2. Paste the install command and press Return. It "shows no progress while it downloads".
  3. When it finishes, open a new Terminal window.
  4. Check it worked. A working install prints a version number followed by "(Claude Code)".
  5. Move into your project folder and start Claude Code, then sign in when asked.
curl -fsSL https://claude.ai/install.sh | bash
claude --version
cd /path/to/your/project
claude
Anthropic's Claude Code documentation, Install Claude Code section, showing the native install commands for macOS, Linux and WSL, Windows PowerShell and Windows CMD, with tabs for Native Install (Recommended), Homebrew and WinGet
Install Claude Code, Advanced setup page, code.claude.com, 29 October 2026. Screenshot: aiagents.org.uk

Installing Claude Code with Homebrew

If you already use Homebrew, this works too. The claude-code cask follows the stable channel, which Anthropic says is "typically about a week behind and skips releases with major regressions". The claude-code@latest cask gets each release as it ships.

brew install --cask claude-code

Homebrew installs do not update themselves, so run brew upgrade claude-code now and then, or brew upgrade claude-code@latest if you installed that cask. If Homebrew says the cask "is unavailable", your Homebrew index is out of date: run brew update and try again.

A Mac older than macOS 13 shows a dyld error, and Homebrew will not help, as it downloads the same program.

How do you install Claude Code on Windows?

On Windows, run the installer from PowerShell; you do not need Administrator rights. You can also use Command Prompt, WinGet, or install inside WSL if you want Linux tools or sandboxing.

Check your shell first: the prompt shows PS C:\ in PowerShell and C:\ without the PS in Command Prompt (CMD).

In PowerShell:

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

In Command Prompt:

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

Then open a new window and run claude --version.

  • Git for Windows is optional but recommended. Without it, Claude Code runs commands through PowerShell. Download it from git-scm.com.
  • WinGet works too: winget install Anthropic.ClaudeCode. It does not update itself, so run winget upgrade Anthropic.ClaudeCode periodically.
Anthropic's Set up on Windows table comparing Native Windows, WSL 2 and WSL 1: sandboxing is not supported on native Windows or WSL 1 and is supported on WSL 2, and native Windows does not need Administrator rights
Set up on Windows, Advanced setup page, code.claude.com, 29 October 2026. Screenshot: aiagents.org.uk

Native Windows or WSL?

Choose native Windows for Windows projects and tools. Choose WSL 2 for Linux toolchains or if you want sandboxing, which runs commands in a restricted environment: Anthropic's table says sandboxing is "Not supported" on native Windows and WSL 1, and "Supported" on WSL 2.

In WSL, open your Linux distribution and run the Linux command, curl -fsSL https://claude.ai/install.sh | bash, inside the WSL terminal, not in PowerShell. WSL setups do not need Git for Windows. If WSL 1 prints Exec format error, Anthropic's fix is to convert the distribution to WSL 2 from PowerShell:

wsl --set-version <DistroName> 2

How do you install Claude Code on Linux?

On Linux, the same one-line installer used on a Mac works. For servers you manage with a package manager, Anthropic also runs signed apt, dnf and apk repositories.

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

The repositories offer a stable channel, about a week old, and a latest channel. They do not update through Claude Code: updates arrive with your normal system upgrades. For Debian and Ubuntu, Anthropic's apt steps are:

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

Anthropic suggests checking the key with gpg --show-keys before continuing. Then:

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 and RHEL users add a claude-code.repo file and run sudo dnf install claude-code; Alpine users add the apk key and run apk add claude-code. The full dnf and apk steps are on the setup page.

On Alpine, first run apk add bash curl libgcc libstdc++ ripgrep. On a small cloud server, a Killed message means it ran out of memory: Anthropic says installing needs "roughly 512MB of free memory", and suggests adding swap space or a larger instance.

Can you still install Claude Code with npm?

Yes. Anthropic still documents the npm package, but as an advanced option rather than the main route. It needs Node.js 22 or later and installs the same native program as the installer.

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

Anthropic warns: "Do NOT use sudo npm install -g". To upgrade, use npm install -g @anthropic-ai/claude-code@latest rather than npm update -g. On npm 12, if claude prints "claude native binary not installed", Anthropic's simplest fix is to switch to the native installer and remove the npm package.

How do you sign in: Claude plan or API key?

Most people sign in with a Claude subscription through the browser the first time they run claude. The alternative is a Claude Console account, which bills per token through the API.

Anthropic's setup page is clear: "Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access." Subscriptions share one usage allowance across chat and Claude Code; my guide to Claude usage limits explains the five-hour and weekly windows. The UK prices below come from my Claude pricing UK guide, recorded from Anthropic's UK pricing page on 29 October 2026.

PlanUK price, including VATClaude Code?
Free£0No
Pro£18 a month, or £180 a yearYes
Max 5x£90 a monthYes
Max 20x£180 a monthYes
Team, Standard seat£18 a seat a month billed yearly, or £22.50 monthlyYes
Team, Premium seat£90 a seat a month billed yearly, or £113 monthlyYes
EnterpriseUS$20 a seat a month (about £15), billed annually with a 20-seat minimum, plus usage at API ratesYes
Claude Console (API)Pay per token, for example Sonnet 5.5 at $2 input and $10 output per million tokens (about £1.50 and £7.50)Yes

Claude plans that include Claude Code, as of 29 October 2026. Dollar prices converted at $1 = £0.75.

How each sign-in works:

  • Claude subscription: run claude, sign in in the browser window that opens, and the terminal shows "Login successful".
  • Console account: sign in with your Claude Console credentials instead, billed per token. Anthropic's cost page puts enterprise use at about $13 (about £10) per developer per active day on average.
  • API key: set the ANTHROPIC_API_KEY environment variable before starting. Claude Code asks once whether to use it; if you approve, it skips the login prompt.

Watch for an old API key: an approved ANTHROPIC_API_KEY outranks your subscription login, so a forgotten key can bill the API instead of your plan. Type /status inside Claude Code to see which method is active.

What happens the first time you run Claude Code?

The first time, Claude Code asks you to sign in and to trust the folder you started it in. After that, the prompt appears with the version, model and folder shown above it.

  1. Start it in a project folder with claude.
  2. Sign in through your browser. On a Mac the login is saved in the Keychain; on Linux in ~/.claude/.credentials.json, and on Windows in %USERPROFILE%\.claude\.credentials.json.
  3. Answer the workspace trust dialog. Only trust folders whose contents you know.
  4. Ask something simple, such as what does this project do?. Claude reads files as it needs them.
  5. Try a small change. If Claude asks before editing, choose Yes; Shift+Tab changes how much it may do unasked.

Type /help for commands, /login to switch accounts and /logout to sign out. To extend it later, see my guides to Claude Code skills and adding MCP servers.

How do you update Claude Code to the latest version?

A native install updates itself in the background, and the new version takes effect next time you start Claude Code. To update straight away, run claude update.

claude update

Homebrew, WinGet and Linux package installs need their own upgrade commands, listed in the table above.

Latest version, verified: 2.1.312, released on 27 October 2026, is the top entry in Anthropic's Claude Code changelog. On 29 October 2026 the npm registry listed 2.1.312 as "latest" (published 27 October at 18:36 UTC) and 2.1.308 as "stable", and Homebrew showed the claude-code cask at 2.1.308 and claude-code@latest at 2.1.312.

Claude Code changelog on Anthropic's documentation site showing version 2.1.312 dated October 27, 2026 at the top, with its Added and Changed lists
Claude Code changelog, code.claude.com, 29 October 2026. Screenshot: aiagents.org.uk

To switch channel, type /config and pick "latest" (the default) or "stable", or install stable directly:

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

How do you uninstall Claude Code?

Delete the program files for your install method. Removing settings and history is a separate, optional step.

Native install on a Mac, Linux or WSL:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Native install on Windows, in PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Other methods: brew uninstall --cask claude-code (or brew uninstall --cask claude-code@latest), winget uninstall Anthropic.ClaudeCode, sudo apt remove claude-code or npm uninstall -g @anthropic-ai/claude-code.

To wipe settings, MCP servers and session history too, delete ~/.claude and ~/.claude.json. Remove the VS Code extension, JetBrains plugin and desktop app first, or they recreate the folder.

Installing Claude Code: common errors and fixes

Most installation errors come from one of three causes: the install folder is not on your PATH, the command is for a different shell, or the download was blocked. Anthropic's Troubleshoot installation and login page matches each message to a fix.

Anthropic's Find your error table on the Troubleshoot installation and login page, matching messages such as command not found claude, syntax error near unexpected token, curl 403 and Killed during install to their fixes
Find your error, Troubleshoot installation and login, code.claude.com, 29 October 2026. Screenshot: aiagents.org.uk
What you seeWhat it meansFix
command not found: claude or 'claude' is not recognizedThe install folder is not on your PATHOpen a new terminal; if it persists, add the folder to PATH (below)
syntax error near unexpected token '<' or a 403The installer got a web page, not the scriptRetry later; check region and proxy; or use Homebrew or WinGet
'irm' is not recognizedYou are in CMD, not PowerShellUse the CMD command, or open PowerShell
The token '&&' is not a valid statement separatorYou are in PowerShell, not CMDUse irm https://claude.ai/install.ps1 | iex
Claude Code does not support 32-bit WindowsYou opened Windows PowerShell (x86)Open Windows PowerShell without x86
API Error: 403 Request not allowedSubscription inactive or missing Console roleCheck claude.ai/settings or ask your admin
This organization has been disabledAn old API key overrides your planRemove ANTHROPIC_API_KEY from your shell profile

Common Claude Code installation and login errors, from code.claude.com/docs/en/troubleshoot-install, 29 October 2026.

Fix your PATH

The installer puts Claude Code in ~/.local/bin on a Mac or Linux, or %USERPROFILE%\.local\bin on Windows. On a Mac using Zsh, the default shell, Anthropic's fix is:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

For Bash on Linux, use ~/.bashrc in place of ~/.zshrc. Windows users add the folder to their User PATH; the troubleshooting page has the PowerShell commands.

Then restart the terminal, and any editor whose built-in terminal you use.

Login fails in WSL, SSH or a container

If no browser opens, or it lands on a localhost error, press c to copy the login URL, open it on your own computer and paste the code it shows at the "Paste code here" prompt. For anything else, claude doctor prints a read-only health check of your install and settings.

Which Claude CLI commands should you know?

After installing, a handful of Claude CLI commands cover almost everything: claude to start, claude --version and claude doctor to check, claude update to update, and claude auth to manage sign-in.

Claude Code install commands card, checked 29 October 2026, listing commands for Mac, Linux and WSL and for Windows PowerShell to install, check, start, update and uninstall, with the latest version 2.1.312 and stable channel 2.1.308
Claude Code install commands card, from Anthropic's setup docs and changelog, the npm registry and Homebrew, checked 29 October 2026. Graphic: aiagents.org.uk
  • claude auth status shows whether you are signed in and how.
  • claude setup-token creates a long-lived token for scripts and CI; it needs a Claude subscription.

Want to run it without Anthropic's models? My guide to Claude Code with Ollama covers pointing it at a local model, with the trade-offs.

Frequently asked questions

Is Claude Code free to install?

The program is free to download, but you cannot use it without a paid account. Anthropic says Claude Code needs Pro, Max, Team, Enterprise or a Claude Console account, and the free Claude plan does not include it. The cheapest route in the UK is Claude Pro at £18 a month including VAT, as of 29 October 2026.

Do I need Node.js to install Claude Code?

No. The recommended native installer, Homebrew, WinGet and the Linux repositories do not need Node.js. Only the npm install method does, and it requires Node.js 22 or later. Even then, npm installs the same native program, which does not use Node.js when it runs.

Should I use the native installer or Homebrew on a Mac?

Use the native installer unless you manage everything through Homebrew. The native install updates itself in the background. Homebrew installs do not, so you must run brew upgrade claude-code yourself. The claude-code cask also follows the stable channel, which Anthropic says is typically about a week behind the latest release.

Can I install Claude Code on Windows without WSL?

Yes. Claude Code runs natively on Windows 10 version 1809 or later. Run the PowerShell installer, no Administrator rights needed. Git for Windows is optional but lets Claude Code use Git Bash. Choose WSL 2 instead if you want sandboxing, which Anthropic says is not supported on native Windows.

How do I check which version of Claude Code I have?

Run claude --version in a terminal. It prints a version number followed by (Claude Code). On 29 October 2026 the latest release was 2.1.312, from 27 October, and the stable channel was on 2.1.308. Run claude update to move to the newest version straight away.

Sources

About the author

Annie has spent twenty years in search, lead generation and ad tech, on the agency, client and publisher side, and has worked in growth for an AI agent platform. She writes aiagents.org.uk independently: no AI vendor pays for coverage. More about Annie · How guides are made · LinkedIn

Scroll to Top