How to Install Claude Code on macOS, Linux and Windows
Install Claude Code on macOS, Linux or Windows. Choose your terminal, verify the install, sign in, fix common errors and update or uninstall it.
Published

The simplest way to install Claude Code is to run Anthropic’s native installer in your terminal. It updates itself and works without Node.js. If sign-in failed on an earlier attempt, open a fresh terminal and run claude --version first. A version number means the program is already there.
How to install Claude Code on your machine
Have a terminal, a project folder and an account ready. For a personal machine, the simplest sign-in is a Claude Pro, Max or Ultra subscription. Team and Enterprise accounts also qualify. Claude Free doesn’t include Claude Code. A Claude Console account with prepaid API credits is another route. If your employer provides access through a supported cloud provider or a Claude apps gateway, use its account setup. Anthropic’s quickstart
The terminal installer needs an x64 or ARM64 processor, at least 4 GB of RAM, internet access and an Anthropic-supported location. Supported shells include Bash, Zsh, PowerShell and Windows Command Prompt (CMD). We verified the requirements and commands on December 2, 2026. Anthropic’s setup documentation
Pick one install method. Use native on your own machine unless you already manage developer tools with a package manager such as Homebrew or WinGet. Installing a second copy can leave your terminal opening the older one even after an upgrade.
How to install Claude Code on macOS
On macOS 13.0 or later, open Terminal and run this native installer. The download can be silent. Wait for the installer to finish before opening a new terminal window.
curl -fsSL https://claude.ai/install.sh | bashHomebrew alternative. If Homebrew manages the rest of your tools, use its stable cask (the Homebrew package for this application).
brew install --cask claude-codeThe stable cask skips releases with major regressions and usually trails the newest release by about a week. Homebrew also offers the claude-code@latest cask. Remember which one you installed when it’s time to update.
How to install Claude Code on Linux
On Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+, use the native installer for an individual account. On a fresh Alpine system, install its missing prerequisites first with apk add bash curl. Then run the installer in your Linux terminal.
curl -fsSL https://claude.ai/install.sh | bashIf you manage system software centrally, Anthropic also publishes signed repositories for apt, dnf and apk. Choose the tab for your distribution. These commands select the stable channel. The Linux repository instructions also give the latest-channel addresses.
How to install Claude Code on Ubuntu or Debian with apt. If curl or GnuPG is missing, install them with sudo apt install curl gnupg. Download the signing key and display its fingerprint.
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.ascgpg --show-keys /etc/apt/keyrings/claude-code.ascContinue only if the single fingerprint reads 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. Then register the repository, refresh the package list and install.
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-codeThe repository file tells dnf where to find the package and which key verifies it. At the first install, compare the fingerprint dnf displays with 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE before accepting it.
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-codeDownload the repository key, then check it before installing the package.
wget -O /etc/apk/keys/claude-code.rsa.pub \
https://downloads.claude.ai/keys/claude-code.rsa.pub
sha256sum /etc/apk/keys/claude-code.rsa.pubThe expected checksum is 395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6. If it matches, add the repository and install.
echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
apk add bash claude-codeHow to install Claude Code on Windows
For a project you work on in native Windows, use PowerShell or Command Prompt on Windows 10 version 1809 or later, or Windows Server 2019 or later. A regular terminal window is enough. Git for Windows is optional. Installing it gives Claude Code access to Git Bash. Without it, Claude Code uses PowerShell to run shell commands.
PowerShell. If your prompt starts with PS C:\, run this command.
irm https://claude.ai/install.ps1 | iexCommand Prompt. If the prompt looks like C:\Users\YourName>, use the CMD installer.
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdIf CMD says it doesn’t recognize irm, you pasted the PowerShell command. If PowerShell rejects &&, use the PowerShell line above. Both install the same program.
WinGet alternative. For a Windows machine you maintain with WinGet, use its package instead.
winget install Anthropic.ClaudeCodeWindows Subsystem for Linux (WSL)
If you open your project in a Linux distribution under WSL, open that distribution’s terminal, run the Linux installer below, and launch claude there. WSL doesn’t need Git for Windows. Choose WSL 2 if you need sandboxed command execution, which limits what its shell commands can access. Native Windows and WSL 1 don’t support that sandbox.
curl -fsSL https://claude.ai/install.sh | bash
Installing with npm
Use npm, the Node.js package manager, if you already manage global developer tools that way. The package requires Node.js 22 or later to install and downloads a native executable. Check npm --version first. If it starts with 12, use the native installer above or follow Anthropic’s npm 12 setup before running the command. That npm release can skip the step that puts the executable in place.
npm install -g @anthropic-ai/claude-code@latestRun this as your own user. Using sudo for a global npm install can leave the program unable to update under your account.
Check the installation and sign in
Check that your terminal can find the program. Open a fresh terminal window in the environment where you installed it and enter the command below.
claude --versionA working install prints a version number followed by (Claude Code). For more detail, run claude doctor at the shell prompt. It checks installation health and settings and reports warnings without starting a session.
Sign in from your project. Open the project folder in your terminal and enter the command below.
claudeFollow the prompt for your Claude subscription or Console account and finish sign-in in the browser. Return to the terminal. The Claude Code prompt shows the working directory, so you can check that you opened the right project. If you have an ANTHROPIC_API_KEY set and approve using it when asked, Claude Code uses the key and skips the browser login.

Fix a failed installation or login
Start with the earliest step that failed. If the version prints and the browser loops, go straight to the sign-in row. Anthropic’s installation and login troubleshooting
How to update Claude Code
Native installations update in the background by default. Restart Claude Code to pick up the new version. To request an update immediately, run claude update. If the version still looks old, run claude doctor to see the last recorded update attempt.
For a package-managed install, run the command that matches how you installed it. Homebrew and WinGet require a manual upgrade by default, and Linux repository installs follow the system’s package workflow.
- Homebrew:
brew upgrade claude-codefor stable orbrew upgrade claude-code@latestfor latest. - WinGet:
winget upgrade Anthropic.ClaudeCode. - apt:
sudo apt update && sudo apt upgrade claude-code. - dnf:
sudo dnf upgrade claude-code. - apk:
apk update && apk upgrade claude-code. - npm:
npm install -g @anthropic-ai/claude-code@latest.
How to uninstall Claude Code
Native macOS, Linux or WSL. The first line removes the launcher and the second removes its downloaded program versions. Run them in the environment where you installed Claude Code.
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claudeNative Windows. Open PowerShell under the account you used to install it.
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -ForcePackage managers. For Homebrew, run brew uninstall --cask claude-code or brew uninstall --cask claude-code@latest, matching the installed cask. For WinGet, use winget uninstall Anthropic.ClaudeCode. For npm, use npm uninstall -g @anthropic-ai/claude-code.
For Linux repositories, use sudo apt remove claude-code, sudo dnf remove claude-code or apk del claude-code. Follow the repository cleanup steps for your package manager to remove the source you added.
Uninstalling the executable leaves your personal settings and session data available for a reinstall. If claude --version still prints a version after removal, check for another installation or an old shell alias before deleting any personal files.
Desktop app and Visual Studio Code
Claude Desktop. Download the app for macOS or Windows, or use the Linux beta for Ubuntu or Debian.
Sign in and select the Code tab. Desktop installation and downloads
How to install Claude Code in VS Code
In Visual Studio Code 1.94.0 or later, open Extensions and install Anthropic’s Claude Code extension.
The extension includes its own copy for the chat panel. To type claude in the integrated terminal, install the standalone CLI as well. VS Code extension setup
Installation questions
Can I install the Claude code for free?
You can install the program and check its version before signing in. To start a session, you need an eligible subscription, a funded Console account or access provided by your organization.
How do I enable the Claude code?
Once the version check succeeds, open your project folder in the terminal and run claude. The first launch walks you through sign-in. If you have already signed in under a different account, enter /login at the Claude Code prompt to switch.
After installation
For terminal commands and when to switch interfaces, see the Claude Code CLI guide.
For your first task in a project, follow How to Use Claude Code.
For a repository workflow, see Claude Code with GitHub Actions. For add-ons to a local installation, see the Claude Code plugin guide.
If you’re deciding which assistant to keep, compare Claude Code and GitHub Copilot.
Subscribe to the newsletter for more developer setup guides.
- Published
- Category
- Build








