To install Claude Code, Anthropic’s terminal coding agent, run the native installer on a machine that meets the documented OS minimums, has 4 GB of RAM, an x64 or ARM64 processor, Bash, Zsh, PowerShell, or CMD, an internet connection, and an Anthropic-supported country. On macOS, Linux, and WSL that command is curl -fsSL https://claude.ai/install.sh | bash; Windows PowerShell uses install.ps1 and Command Prompt uses install.cmd.

Anthropic documents the native installer as the recommended method. On macOS, Linux, and Windows Subsystem for Linux (WSL), you pipe https://claude.ai/install.sh through bash. Windows PowerShell uses install.ps1; Command Prompt uses install.cmd. Stable and pinned builds use shell-specific arguments: bash -s on Unix, a PowerShell scriptblock, and install.cmd <channel-or-version> on CMD. After the binary is on disk, claude --version should print a version number followed by (Claude Code), then claude starts a browser login. If ANTHROPIC_API_KEY is set, Claude Code still asks for one approval of that key instead of opening the browser.

Native installs download updates in the background. Homebrew, WinGet, apt, dnf, and apk take upgrades through those package managers. npm ships the same native binary as a global package through optional dependencies, and auto-updates unless the npm global directory is not writable. Use the matching upgrade and uninstall commands for the method you picked.

What has to be true before you install

A successful install leaves you with a working claude binary, an account Claude Code accepts, a release channel you chose, and an uninstall path that matches the installer. Claude Code is Anthropic’s terminal coding agent: a command-line program that opens in a project directory, reads the files it needs, and helps you write and change code from the shell. Anthropic’s Desktop app is a graphical Claude Code option. This article covers the terminal installer, updates, and uninstall.

Anthropic’s setup page lists these operating-system minimums: macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, and Alpine Linux 3.19+. Hardware is 4 GB of RAM or more and an x64 or ARM64 processor. An internet connection is required. The documented shells are Bash, Zsh, PowerShell, and CMD. The setup page’s location requirement is an Anthropic supported country.

Claude Code requires a Pro, Max, Team, Enterprise, or Console account, or Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Anthropic’s docs state that the free claude.ai plan does not include Claude Code access. Use those cloud products’ own setup pages for provider credentials.

After claude runs, log in. The first coding prompts live on Anthropic’s quickstart. For command not found, PATH issues, EACCES, TLS errors, or a curl 403 during install, use Anthropic’s Troubleshoot installation and login page. Login loops, OAuth errors, and a login 403 Forbidden belong on that same page’s login and authentication section.

Claude Code setup

Anthropic supported countries

Troubleshoot installation and login

Anthropic documents the native installer as the recommended method. On macOS, Linux, and Windows Subsystem for Linux (WSL), pipe the install script through bash. Native installations update in the background.

Windows PowerShell uses irm https://claude.ai/install.ps1 | iex. Windows CMD uses curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. If you see The token '&&' is not a valid statement separator, you are in PowerShell. If you see 'irm' is not recognized as an internal or external command, you are in CMD. PowerShell prompts start with PS C:\; CMD prompts show C:\ without PS.

On macOS and Linux the launcher is ~/.local/bin/claude, a symlink into ~/.local/share/claude/versions/. After the installer finishes, open a terminal in your project and run claude.

The native installer accepts latest, stable, or a version such as 2.1.89 (Anthropic’s example pin). The channel you choose at install becomes the auto-update default. Each shell has its own syntax: bash uses bash -s, PowerShell uses a scriptblock, and CMD passes the argument to install.cmd.

  • macOS, Linux, WSL (latest): curl -fsSL https://claude.ai/install.sh | bash
  • Windows PowerShell (latest): irm https://claude.ai/install.ps1 | iex
  • Windows CMD (latest): curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
  • Stable, macOS/Linux/WSL: curl -fsSL https://claude.ai/install.sh | bash -s stable
  • Stable, PowerShell: & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
  • Stable, CMD: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd
  • Pinned example 2.1.89, macOS/Linux/WSL: curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89
  • Pinned example 2.1.89, PowerShell: & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.89
  • Pinned example 2.1.89, CMD: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 2.1.89 && del install.cmd
curl -fsSL https://claude.ai/install.sh | bash

Homebrew, WinGet, Linux repos, and npm

Homebrew installs with brew install --cask claude-code, which tracks the stable channel (typically about a week behind, skipping releases with major regressions). brew install --cask claude-code@latest tracks latest. Upgrade with the matching brew upgrade cask. Homebrew keeps old versions on disk; brew cleanup reclaims space.

WinGet installs with winget install Anthropic.ClaudeCode and upgrades with winget upgrade Anthropic.ClaudeCode.

Claude Code publishes signed apt, dnf, and apk repositories, each with stable and latest channels. Stable is typically about a week old and skips releases with major regressions; latest ships every release as soon as it is out. The commands below configure stable, which the setup page says fits most users. Package-manager installs take updates through your normal system upgrade workflow.

On Debian and Ubuntu, install curl and gnupg if they are missing (sudo apt install curl gnupg). The commands in the code block create /etc/apt/keyrings, download the signing key, print it for a fingerprint check, write /etc/apt/sources.list.d/claude-code.list, then install the package. The fingerprint should be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. If the key download fails, apt update later fails with NO_PUBKEY BAA929FF1A7ECACE. For latest, both the URL path and the suite name change: deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/latest latest main. Upgrade later with sudo apt update && sudo apt upgrade claude-code.

On Fedora and RHEL, the commands in the code block write /etc/yum.repos.d/claude-code.repo and install the package. For latest, set baseurl=https://downloads.claude.ai/claude-code/rpm/latest. dnf downloads the key on first install and prompts for the fingerprint; confirm 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE before accepting. Upgrade later with sudo dnf upgrade claude-code.

sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'
[claude-code]
name=Claude Code
baseurl=https://downloads.claude.ai/claude-code/rpm/stable
enabled=1
gpgcheck=1
gpgkey=https://downloads.claude.ai/keys/claude-code.asc
EOF
sudo dnf install claude-code

On Alpine, download https://downloads.claude.ai/keys/claude-code.rsa.pub to /etc/apk/keys/claude-code.rsa.pub, add https://downloads.claude.ai/claude-code/apk/stable to /etc/apk/repositories, then apk add claude-code. For latest, run sed -i '\|downloads.claude.ai/claude-code/apk/stable|d' /etc/apk/repositories and add https://downloads.claude.ai/claude-code/apk/latest. sha256sum /etc/apk/keys/claude-code.rsa.pub should report 395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6. Upgrade later with apk update && apk upgrade claude-code.

npm installs the same native binary: npm install -g @anthropic-ai/claude-code. npm pulls that binary in through a per-platform optional dependency such as @anthropic-ai/claude-code-darwin-arm64, so the package manager must allow optional dependencies. As of v2.1.198 the package requires Node.js 22 or later. On older Node, npm prints EBADENGINE and the install can still complete because the CLI downloads a native binary and does not run on Node at runtime. The npm package auto-updates unless the npm global directory is not writable, in which case startup shows a one-time notice and claude doctor lists fixes. Upgrade with npm install -g @anthropic-ai/claude-code@latest. Anthropic warns against npm update -g, which may stay inside the original semver range, and against sudo npm install -g, which can cause permission issues and security risks. Supported npm platforms are darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win32-x64, and win32-arm64.

  • brew install --cask claude-code
  • brew install --cask claude-code@latest
  • winget install Anthropic.ClaudeCode
  • npm install -g @anthropic-ai/claude-code
  • Latest apt suite line: deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/latest latest main
  • Latest dnf baseurl: https://downloads.claude.ai/claude-code/rpm/latest
  • Latest apk repo: https://downloads.claude.ai/claude-code/apk/latest

Documented update path by install method

Method Background auto-update Upgrade command
Native Yes, on startup and while running claude update
Homebrew Manual by default; CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 brew upgrade claude-code or brew upgrade claude-code@latest
WinGet Manual by default; CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 winget upgrade Anthropic.ClaudeCode
apt Manual (elevated privileges) sudo apt update && sudo apt upgrade claude-code
dnf Manual (elevated privileges) sudo dnf upgrade claude-code
apk Manual (elevated privileges) apk update && apk upgrade claude-code
npm Yes, unless the npm global directory is not writable npm install -g @anthropic-ai/claude-code@latest
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

Windows native versus WSL, and Alpine extras

Native Windows install runs from PowerShell or CMD without Administrator. Git for Windows is optional for the install. Without it, Claude Code runs shell commands through the PowerShell tool. With Git for Windows, Claude Code uses Git Bash for the Bash tool. WSL setups skip Git for Windows. If Claude Code cannot find Git Bash, set CLAUDE_CODE_GIT_BASH_PATH in the user settings file ~/.claude/settings.json to C:\Program Files\Git\bin\bash.exe. That override is only for Windows when Git Bash is installed and not found.

Anthropic’s Windows table documents sandboxing as unsupported on native Windows, supported on WSL 2, and unsupported on WSL 1. For the WSL path, install and launch claude inside the WSL terminal. On WSL, search across /mnt/c can return fewer matches even when claude doctor shows Search as OK. Documented mitigations: narrower searches, keep the project under /home/, or run native Windows.

Alpine and other musl/uClibc systems need bash and curl for the install command, and libgcc, libstdc++, and ripgrep at runtime. Alpine omits bash and curl by default, so the documented curl command fails with not found until those packages are present. The documented Alpine example is apk add bash curl libgcc libstdc++ ripgrep. On Alpine, ripgrep lives in the community repository. If apk cannot find ripgrep, add that release’s community repository to /etc/apk/repositories, run apk update, and retry apk add. The docs’ https://dl-cdn.alpinelinux.org/alpine/v3.22/community URL is an example for Alpine 3.22. After the packages are installed, set USE_BUILTIN_RIPGREP to 0 in the env key of ~/.claude/settings.json. That flag is a separate switch from the Windows Git Bash path.

Documented Windows setup options

| Option | Requires | Sandboxing | When to use |

| — | — | — | — |

| Native Windows | None; Git for Windows is optional | Not supported | Windows-native projects and tools |

| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |

| WSL 1 | WSL 1 enabled | Not supported | If WSL 2 is unavailable |

~/.claude/settings.json

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

Prove the binary, then log in

Run claude --version. A working installation prints a version number followed by (Claude Code). Anthropic’s example string is 2.1.211 (Claude Code).

claude doctor prints read-only installation and settings diagnostics without starting a session, including install health, settings-file validation errors, and warnings with suggested fixes. Run it after install and after you change auto-update flags. Its report is a separate diagnostic from the version line.

Log in by running claude and following the browser prompts. If the ANTHROPIC_API_KEY environment variable is set, Claude Code prompts once to approve the key. Inside a running session, type /login to switch accounts. If your organization runs a self-hosted Claude apps gateway, the admin pre-configures the gateway URL, and /login opens on the Cloud gateway screen for corporate SSO.

If the Search tool, @file mentions, custom agents, or custom skills miss files, install your platform’s ripgrep package and set USE_BUILTIN_RIPGREP to 0 in the env key of ~/.claude/settings.json. Confirm in claude doctor that Search shows the system path instead of OK (bundled).

claude --version

Example output: 2.1.211 (Claude Code)

Claude Code quickstart

Search and discovery issues

Auto-update, channels, pins, and freeze flags

Native installs check for updates on startup and periodically while running. Updates download in the background and take effect the next time you start Claude Code. claude update applies immediately. A successful native update reports Successfully updated from <old version> to version <new version>. An already-current native install reports Claude Code is up to date (<version>). For an already-current Homebrew, WinGet, or apk install, claude update reports Claude is up to date!.

autoUpdatesChannel is latest by default, or stable (typically about a week old, skipping releases with major regressions). Set it via /config → Auto-update channel, or in the user settings file ~/.claude/settings.json. Homebrew chooses channel by cask name instead of this setting: claude-code tracks stable and claude-code@latest tracks latest.

minimumVersion is a floor: background auto-updates and claude update refuse any version below it. With that floor set, moving to stable leaves a newer latest build in place. Switching from latest to stable via /config prompts you to stay on the current version or allow the downgrade. Choosing to stay sets minimumVersion to the current version. Switching back to latest clears that floor. Add minimumVersion in ~/.claude/settings.json to pin a floor yourself; Anthropic’s setup page uses 2.1.100 as a sample value, and you set the floor you want. Managed requiredMinimumVersion and requiredMaximumVersion make Claude Code refuse to start outside a version range, and updates respect the requiredMaximumVersion ceiling.

Set DISABLE_AUTOUPDATER to 1 in the env key of ~/.claude/settings.json to stop background checks. claude update and claude install still work. On a native or npm install, claude doctor should show Auto-updates as disabled (set by env: DISABLE_AUTOUPDATER). DISABLE_UPDATES blocks every update path, including manual updates.

Homebrew, WinGet, apt, dnf, and apk installations do not auto-update by default. Set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 to have Claude Code run the Homebrew or WinGet upgrade in the background and show a restart prompt on success. On WinGet the upgrade may fail while Claude Code is running because Windows locks the executable; Claude Code then shows the manual command. apt, dnf, and apk still need a manual upgrade because those commands need elevated privileges. Anthropic documents a known issue: Claude Code may notify you of an update before that version is available in Homebrew, WinGet, apt, dnf, or apk. If an upgrade fails, wait and try again later.

From v2.1.207 onward, auto-update and claude update leave a custom launcher at ~/.local/bin/claude in place. Before that version the updater replaced a custom launcher with its own symlink on every update. To let the native installer manage the launcher again, remove ~/.local/bin/claude and run claude update.

From 2.1.89 onward each release publishes a GPG-signed manifest.json of SHA256 checksums. Import the key from https://downloads.claude.ai/keys/claude-code.asc and confirm fingerprint 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. macOS binaries are signed by Anthropic PBC and notarized by Apple. Windows binaries are signed by Anthropic, PBC. Linux binaries are not individually code-signed; use the manifest or the apt, dnf, or apk repository key.

~/.claude/settings.json

{
  "autoUpdatesChannel": "stable",
  "minimumVersion": "2.1.100"
}

Uninstall the method you used, then decide about config

Remove Claude Code with the same method you used to install it. The list below matches each installer. If claude still runs afterward, Anthropic says a second installation or leftover shell alias from an older installer is likely. Use Check for conflicting installations on the Troubleshoot installation page.

User settings live in ~/.claude and ~/.claude.json. Project settings live in .claude and .mcp.json in the repo. MCP (Model Context Protocol) servers are extra tools Claude Code loads from those config files. Deleting those paths removes settings, allowed tools, MCP server configurations, and session history. The VS Code extension, JetBrains plugin, and Desktop app recreate ~/.claude if they remain installed.

The changelog page is generated from CHANGELOG.md on GitHub. Check what you have with claude --version.

  • Native macOS, Linux, WSL: rm -f ~/.local/bin/claude and rm -rf ~/.local/share/claude
  • Native Windows PowerShell: Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force then Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
  • brew uninstall --cask claude-code
  • brew uninstall --cask claude-code@latest
  • winget uninstall Anthropic.ClaudeCode
  • sudo apt remove claude-code then sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
  • sudo dnf remove claude-code then sudo rm /etc/yum.repos.d/claude-code.repo
  • apk del claude-code, then sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories, then rm /etc/apk/keys/claude-code.rsa.pub
  • npm uninstall -g @anthropic-ai/claude-code
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Pick the installer that matches your OS, run claude --version and claude doctor, log in with claude, then use that same method for upgrades and uninstall.

Sources