> ## Content Index
> Fetch the complete content index at: https://claudefox.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to install Claude Code on Mac, Windows and Linux
- URL: https://claudefox.com/install-claude-code/
- Published: 2026-11-20T07:08:07.000Z
- Updated: 2026-11-20T11:44:47.000Z
- Description: Step-by-step Claude Code install for macOS, Windows and Linux, checked against Anthropic's docs: the native installer, Homebrew, WinGet, apt, dnf and npm, system requirements, first login, updates, and fixes for the errors people hit most.
- Author: hupicake
- Tags: Tips

*Updated November 20, 2026: Rechecked against Anthropic's docs on November 20: added the apt key check, more PATH and uninstall fixes, and corrected the npm permission fix.*

Last checked: 2026-11-20, against Anthropic's Claude Code setup, quickstart, authentication and installation troubleshooting docs. As of that date the newest release in the Claude Code changelog is 2.1.329, published on GitHub on November 19\. Commands below follow the official setup docs, and the error table links the troubleshooting section for each fix.

The native installer takes one command; the Homebrew, WinGet and Linux package routes take a few more. What trips people up is everything around it: the wrong shell on Windows, a PATH that was never updated, an old API key that overrides a subscription. This guide covers the install, the first login and the fixes for those problems.

## What do you need before installing Claude Code?

You need a 64-bit Mac, Windows or Linux machine with 4 GB of RAM, an internet connection in a supported country, and a paid Claude plan, a Console account or a supported cloud provider. The details:

- 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.
- Shell: Bash, Zsh, PowerShell or CMD, plus an internet connection.
- Location: one of Anthropic's supported countries. Elsewhere the installer fails with "App unavailable in region".
- An account: Claude Pro, Max, Ultra, Team or Enterprise, a Claude Console account, or access through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. The free Claude plan does not include Claude Code; our pricing guide compares the plans.

You do not need Node.js for the recommended installer. Git is optional, though on native Windows Anthropic recommends Git for Windows so Claude Code can use its Bash tool.

## How do you install Claude Code on a Mac?

Open Terminal and run the native installer. It shows no progress while it downloads, and native installs update themselves in the background:

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

If you prefer Homebrew, there are two casks. claude-code follows the stable channel, which the docs say is typically about a week behind and skips releases with major regressions; claude-code@latest gets every release. Homebrew installs do not auto-update, so upgrade them yourself:

```
brew install --cask claude-code
brew upgrade claude-code
```

## How do you install Claude Code on Windows?

Run the installer that matches your shell, in PowerShell or CMD; you can also run Claude Code inside WSL. You do not need to run the installer as Administrator. Use the command that matches your shell: the prompt shows PS C:\\ in PowerShell and just C:\\ in CMD.

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

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

# WinGet (no auto-update; run winget upgrade Anthropic.ClaudeCode later)
winget install Anthropic.ClaudeCode
```

Without Git for Windows, Claude Code runs shell commands through its PowerShell tool; with it, Claude Code uses Git Bash. The choice between native and WSL matters for one feature: Claude Code's command sandbox works in WSL 2 but not on native Windows, where commands run unsandboxed. The sandbox is off by default; you turn it on with /sandbox, and on Linux and WSL 2 it relies on bubblewrap and socat. For WSL, open your Linux distribution and run the Linux installer there, then launch claude inside WSL rather than from PowerShell.

## How do you install Claude Code on Linux?

Run the same native installer as on a Mac; the script works on Linux and WSL:

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

On Alpine and other musl-based distributions, install bash and curl first with apk add bash curl. Anthropic also publishes signed apt, dnf and apk repositories with stable and latest channels. On Debian or Ubuntu, the stable channel looks like this. Check that gpg prints only the fingerprint 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE before you register the repository; the setup docs list the dnf and apk equivalents:

```
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
gpg --show-keys /etc/apt/keyrings/claude-code.asc
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
```

Package-manager installs need a manual upgrade, for example sudo apt update && sudo apt upgrade claude-code. On a small VPS, note that the installer needs roughly 512 MB of free memory; if the install ends with "Killed", add swap or free memory and run it again.

## Can you install Claude Code with npm?

Yes. The npm package needs Node.js 22 or later and installs the same native binary as the standalone installer, so the installed claude does not run on Node. Do not use sudo: Claude Code updates itself without sudo, and the docs warn that sudo npm install -g causes permission problems and security risks.

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

To upgrade, run the same command again; the docs advise against npm update -g, which can leave you on an older release. Note that the Claude Code README on GitHub now calls npm installation deprecated and points to the native installer, Homebrew or WinGet instead, so use npm only if you have a reason to.

## How do you check that Claude Code installed correctly?

Open a new terminal window, so it picks up the updated PATH, and run:

```
claude --version
claude doctor
```

A working install prints a version followed by (Claude Code). claude doctor prints read-only diagnostics without starting a session: install health, settings-file errors, the last auto-update attempt and suggested fixes.

## How do you log in on the first run?

Run claude in a project folder and sign in through the browser window it opens. Start with cd your-project and then claude. Choose your Claude subscription account, or Claude Console if you pay through the API. When the terminal shows "Login successful", press Enter.

- If no browser opens, press c to copy the login URL and paste it into a browser yourself.
- On SSH, WSL 2 or a container, sign in through that URL on your local machine, then paste the code the browser shows at the "Paste code here" prompt. claude auth login does the same from the shell.
- If ANTHROPIC\_API\_KEY is set and you approve it, Claude Code skips the login and uses that key instead of your subscription; the Help Center warns this results in API usage charges.
- Inside a session, /status shows which login is active, /login switches accounts and /help lists commands.

## How do you update Claude Code?

Native installs update themselves: they check for updates at startup and while running, then apply them the next time you start Claude Code. Run claude update to update now. In /config you can switch the auto-update channel from latest, the default, to stable, which serves a version about a week old; to avoid a downgrade when you switch, choose the option to stay on your current version. To stop background updates, set DISABLE\_AUTOUPDATER to 1 in the env section of settings.json; claude update still works, and DISABLE\_UPDATES blocks every update path. Homebrew, WinGet, apt, dnf and apk installs only update when you run their upgrade command, unless you opt in with CLAUDE\_CODE\_PACKAGE\_MANAGER\_AUTO\_UPDATE for Homebrew and WinGet.

## How do you fix common Claude Code install errors?

Most install errors come from PATH, the wrong Windows shell, the network or low memory. Find your message below:

__From Anthropic's Troubleshoot installation and login page; each error links its section.__
| Error                                                                                                                                                                                     | Cause and fix                                                                                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [command not found: claude, or 'claude' is not recognized](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#verify-your-path)                                       | \~/.local/bin is not on your PATH. Zsh: echo 'export PATH="$HOME/.local/bin:$PATH"' >> \~/.zshrc, then source \~/.zshrc. Bash on Linux uses \~/.bashrc; Bash on macOS uses \~/.bash\_profile. On Windows, add %USERPROFILE%\\.local\\bin to your User PATH and open a new terminal |
| [syntax error near unexpected token '<', or curl error 403](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#install-script-returns-html-instead-of-a-shell-script) | The install URL returned a web page or error instead of the script: region block, proxy or a temporary outage. Retry later, or use Homebrew on macOS or WinGet on Windows                                                                                                          |
| ['irm' is not recognized, or The token '&&' is not a valid statement separator](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#wrong-install-command-on-windows)  | Wrong command for your shell. irm is for PowerShell, the curl ... install.cmd line is for CMD                                                                                                                                                                                      |
| [A parameter cannot be found that matches parameter name 'fsSL'](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#wrong-install-command-on-windows)                 | You ran the macOS/Linux command in PowerShell. Use irm https://claude.ai/install.ps1 \| iex                                                                                                                                                                                        |
| [Claude Code does not support 32-bit Windows](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#claude-code-does-not-support-32-bit-windows)                         | You opened Windows PowerShell (x86). Open the entry without x86 and rerun                                                                                                                                                                                                          |
| [Killed during install on Linux](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#install-killed-on-low-memory-linux-servers)                                       | Out of memory. The install needs roughly 512 MB free; add swap and rerun                                                                                                                                                                                                           |
| [TLS connect error, or Could not create SSL/TLS secure channel](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#tls-or-ssl-connection-errors)                      | Update CA certificates; on Windows PowerShell 5.1, enable TLS 1.2; behind a corporate proxy, configure its CA                                                                                                                                                                      |
| [Error loading shared library ld-linux-x86-64.so.2](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#linux-musl-or-glibc-binary-mismatch)                           | Wrong musl or glibc build. Check with ldd --version, remove the install and reinstall                                                                                                                                                                                              |
| [EACCES: permission denied during npm install](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#permission-errors-during-installation)                              | Switch to the native installer instead of rerunning npm with sudo                                                                                                                                                                                                                  |
| [Cask 'claude-code' is unavailable](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com#homebrew-cask-unavailable-or-outdated)                                         | Your Homebrew index is old. Run brew update, then install again                                                                                                                                                                                                                    |

## How do you fix Claude Code login errors?

Most login errors come from an expired code, an inactive plan or a stray API key:

- OAuth error: Invalid code: the code expired or was cut off when you copied it. Retry and finish quickly, or press c to copy the full URL.
- API Error: 403 Request not allowed after login: check that your subscription is active at claude.ai/settings; Console users need the Claude Code or Developer role.
- "This organization has been disabled" with an active subscription: an old ANTHROPIC\_API\_KEY is overriding your plan. Unset it, remove it from \~/.zshrc or \~/.bashrc, and restart claude.
- Asked to log in again and again: run /login, and check that your system clock is correct, since token checks depend on it.
- When the cause is unclear, Anthropic suggests a clean reset: run /logout, close Claude Code, start claude and log in again.

## How do you uninstall Claude Code?

Remove it the way you installed it. For a native install on macOS, Linux or WSL, the setup docs say to remove the launcher at \~/.local/bin/claude and the \~/.local/share/claude folder. 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 separately in \~/.claude/, and the docs warn that removing it deletes your settings, allowed tools, MCP server configurations and session history. If claude still runs afterwards, you probably have a second installation, which the troubleshooting page shows how to find.

## Frequently asked questions

- Do I need Node.js to install Claude Code? No. The native installer, Homebrew, WinGet and the Linux repositories need no Node.js. Only the npm package needs Node.js 22 or later.
- Can I use Claude Code for free? No. You need a Pro, Max, Ultra, Team or Enterprise plan, a Console account billed per token, or a supported cloud provider.
- Should I use WSL or native Windows? Native Windows is fine for Windows projects. Use WSL 2 for Linux toolchains or if you want the command sandbox, which native Windows does not support.
- Is there an app instead of the terminal? Yes. The Claude desktop app for macOS and Windows has a Code tab that runs Claude Code, and a Linux beta exists for Ubuntu and Debian. The VS Code extension, which also installs in Cursor, bundles its own copy of the CLI and does not put claude on your PATH.
- How do I install an older or specific version? Pass it to the installer, for example curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89, or bash -s stable for the stable channel. Our version history lists every release.

## Related on claudefox

- [Claude Code version history: all 47 releases since Sep 18, 2026](https://claudefox.com/claude-code-version-history/)
- [Claude Code pricing (November 2026): plans and API costs](https://claudefox.com/claude-code-pricing/)
- [Claude Code usage limits explained: 5-hour and weekly caps](https://claudefox.com/claude-code-usage-limits/)
- [Claude Code vs Codex CLI (2026): which coding agent to use](https://claudefox.com/claude-code-vs-codex/)
- ["Don't ask again" can leak secrets into settings.local.json](https://claudefox.com/don-t-ask-again-can-leak-secrets-into-settings-local-json/)

Source: [Advanced setup: requirements, install, update, uninstall (Claude Code docs)](https://code.claude.com/docs/en/setup?ref=claudefox.com), [Quickstart (Claude Code docs)](https://code.claude.com/docs/en/quickstart?ref=claudefox.com), [Authentication (Claude Code docs)](https://code.claude.com/docs/en/authentication?ref=claudefox.com), [Troubleshoot installation and login (Claude Code docs)](https://code.claude.com/docs/en/troubleshoot-install?ref=claudefox.com), [Configure the sandboxed Bash tool (Claude Code docs)](https://code.claude.com/docs/en/sandboxing?ref=claudefox.com), [Get started with the desktop app (Claude Code docs)](https://code.claude.com/docs/en/desktop-quickstart?ref=claudefox.com), [Claude Code changelog (GitHub)](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md?ref=claudefox.com), [Claude Code README (GitHub)](https://github.com/anthropics/claude-code?ref=claudefox.com), [Anthropic supported countries](https://www.anthropic.com/supported-countries?ref=claudefox.com), [Use Claude Code with your Pro, Max, or Ultra plan (Claude Help Center)](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-max-or-ultra-plan?ref=claudefox.com), [Claude Code overview (Claude Code docs)](https://code.claude.com/docs/en/overview?ref=claudefox.com)