Black Friday sale: 85 Claude Code agents for $29 one-time · lifetime updatesGet access →

How to install Claude Code on Mac, Windows and Linux

Updated · 8 min read

By Shubhranshu, creator of claudeagents · Last reviewed

You can install Claude Code with one command in about two minutes. The recommended installer works on macOS, Linux, WSL and Windows, keeps itself up to date, and doesn't need Node.js.

This guide covers every install method Anthropic supports, how to sign in, how to check the install worked, and how to fix the errors people hit most often. Commands were checked against Anthropic's setup documentation on 16 November 2026.

System requirements#

What Claude Code needs to run
RequirementDetails
macOSmacOS 13 or newer, Intel or Apple Silicon
WindowsWindows 10 (1809) or newer, or Windows Server 2019+. Native or WSL
LinuxUbuntu 20.04+, Debian 10+ or Alpine 3.19+
Hardware4 GB of RAM or more, x64 or ARM64 processor
NetworkAn internet connection, in a country Anthropic supports
AccountA paid Claude plan or a Claude Console account with API credit

Git is optional but strongly recommended, so you can review and undo Claude's changes. On native Windows, Git for Windows lets Claude use Git Bash; without it, Claude uses PowerShell.

Install on macOS, Linux or WSL#

Open Terminal (on a Mac, press Cmd+Space and type Terminal) and run the native installer. It shows no progress while it downloads, so give it a minute.

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

When it finishes, open a new terminal window so your shell picks up the new command. On a Mac you can also use Homebrew: brew install --cask claude-code. Homebrew installs don't update themselves, so run brew upgrade claude-code now and then.

Install on Windows#

Open Windows PowerShell from the Start menu. You don't need to run it as Administrator. Your prompt starts with PS C:\ in PowerShell, and with just C:\ in Command Prompt (CMD).

Windows
# PowerShell
irm https://claude.ai/install.ps1 | iex

# Command Prompt (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

# WinGet
winget install Anthropic.ClaudeCode

If you see irm is not recognized, you're in CMD, so use the CMD line. If you see The token '&&' is not a valid statement separator, you're in PowerShell, so use the PowerShell line.

You can also install inside WSL 2. Open your Linux distribution and use the Linux command above. Use WSL if your projects use Linux tools, or if you want sandboxed commands, which native Windows doesn't support.

Other ways to install#

  • Linux package managers: Anthropic publishes signed apt, dnf and apk repositories with stable and latest channels. They update with your normal system upgrades.
  • npm: npm install -g @anthropic-ai/claude-code@latest installs the same native binary. It needs Node.js 22 or newer. Never use sudo with it.
  • Desktop app: download Claude for Mac, Windows or Linux and use the Code tab. It includes Claude Code, so you don't install anything else. See the desktop app guide.
  • VS Code: install the Claude Code extension from Anthropic. See Claude Code in VS Code.

Sign in#

Go to a project folder and start Claude Code. The first time, it opens your browser so you can sign in with your Claude account or Console account.

terminal
cd your-project
claude

If you set an ANTHROPIC_API_KEY environment variable, Claude Code asks whether to use it and then skips the browser sign-in. You can sign in again any time with /login, or from your shell with claude auth login.

Check that it worked#

terminal
claude --version
claude doctor

claude --version should print a version number. claude doctor checks your installation and settings without starting a session, and suggests fixes for anything wrong.

Fix common install errors#

Common Claude Code install errors and fixes
What you seeFix
command not found: claude or 'claude' is not recognizedThe install folder isn't on your PATH. Open a new terminal first. If it still fails, add ~/.local/bin (Mac and Linux) or %USERPROFILE%\.local\bin (Windows) to your PATH.
syntax error near unexpected token '<'The install script came back as a web page, usually because of a network filter or proxy. Try another network, or install with Homebrew, WinGet or npm.
curl: (22) ... error: 403The download was blocked. Check that you're in a supported country and not behind a filter.
irm is not recognizedYou're in CMD. Use the CMD install line, or open PowerShell.
EACCES: permission deniedDon't use sudo. Fix ownership of the install folder, or use the native installer instead of npm.
Killed during install on LinuxThe machine ran out of memory. Free some up or add swap, then run it again.
The Code tab or claude asks you to upgradeYour plan doesn't include Claude Code. You need Pro or higher, or a Console account.

Anthropic's install troubleshooting page lists every error message with its fix.

On a Mac or Linux with zsh, this line adds the install folder to your PATH: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc, then open a new terminal. Use ~/.bashrc instead if your shell is bash.

Keep Claude Code updated#

The native installer updates itself in the background. To update right away, run claude update. Homebrew users run brew upgrade claude-code, WinGet users run winget upgrade Anthropic.ClaudeCode, and npm users run npm install -g @anthropic-ai/claude-code@latest.

If you'd rather get updates about a week later, after they've been tested more widely, set the release channel to stable in /config.

Uninstall#

For the native install on Mac or Linux, delete ~/.local/bin/claude and ~/.local/share/claude. For Homebrew, run brew uninstall --cask claude-code; for WinGet, winget uninstall Anthropic.ClaudeCode; for npm, npm uninstall -g @anthropic-ai/claude-code. Your settings live in ~/.claude, which you can delete too if you want a clean start.

Frequently asked questions

How do I install Claude Code?

On Mac, Linux or WSL run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell run irm https://claude.ai/install.ps1 | iex. Then open a new terminal, run claude in a project folder and sign in.

Do I need Node.js to install Claude Code?

No. The native installer, Homebrew, WinGet and the Linux packages don't need Node.js. Only the npm method does, and it needs Node.js 22 or newer.

Can I install Claude Code on Windows without WSL?

Yes. Claude Code runs natively on Windows 10 (1809) and newer. Install it from PowerShell, CMD or WinGet. Installing Git for Windows is recommended so Claude can use Git Bash.

Why does it say claude: command not found?

The install folder isn't on your PATH yet. Open a new terminal window first. If that doesn't help, add ~/.local/bin (Mac and Linux) or %USERPROFILE%\.local\bin (Windows) to your PATH.

Is Claude Code free to install?

Installing is free, but using it needs a Pro, Max, Ultra, Team or Enterprise plan or a Claude Console account. See our guide to whether Claude Code is free for the options.

How do I update Claude Code?

The native install updates itself. To update now, run claude update. Homebrew, WinGet and npm installs need their own upgrade command.

Sources

Keep reading