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

How to Install Claude Code on macOS, Linux and Windows

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

Anthropic’s product page for Claude Code
Claude Code

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.

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

Homebrew alternative. If Homebrew manages the rest of your tools, use its stable cask (the Homebrew package for this application).

Bash
brew install --cask claude-code

The 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.

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

If 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.

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

Continue only if the single fingerprint reads 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. Then register the repository, refresh the package list and install.

Bash
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

How 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.

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

Command Prompt. If the prompt looks like C:\Users\YourName>, use the CMD installer.

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

If 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.

Powershell
winget install Anthropic.ClaudeCode

Windows 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.

Bash
curl -fsSL https://claude.ai/install.sh | bash
Windows project paths lead to PowerShell or CMD, while a Linux project on Windows leads to WSL
On a Windows computer, choose the installer for the environment where you open the project.

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.

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

Run 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.

Bash
claude --version

A 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.

Bash
claude

Follow 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.

Three consecutive entrances labeled Install, Check version and Sign in
A version number confirms the local installation. Browser sign-in connects that installation to your account.

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

What you seeWhat to do
command not found: claude or “not recognized” after native installCheck that the launcher exists in ~/.local/bin on macOS or Linux, or %USERPROFILE%\.local\bin on Windows. If it exists, add that directory to PATH, the list of folders your terminal searches. The installer prints the fix for your shell. On Windows, add the folder to your User PATH. Reopen the terminal, and restart the editor too if the terminal is inside it.
Permission denied or npm EACCESOn a native install, check the exact directory the error names. Restore your user’s ownership or write access there. For npm permission failures, switch to the native installer for your system.
npm reports EBADENGINE with an older Node.jsUse Node.js 22 or later and rerun the npm install, or use the standalone installer. npm may finish despite the warning because the downloaded executable runs independently of Node.js.
Sign-in repeats, or the browser returns to an unreachable localhost pageFor repeated sign-in, enter /logout inside Claude Code, close it, restart with claude and sign in again. For a broken browser handoff in WSL or a remote terminal, press c at the login prompt, open the copied URL in your local browser and paste the full returned code into the terminal, including the #.
Downloads or sign-in fail behind a company proxyGet the approved proxy address from IT and set HTTPS_PROXY or HTTP_PROXY before launch. If the company inspects encrypted traffic, ask IT for its root certificate. For a certificate trust error, point NODE_EXTRA_CA_CERTS to the approved PEM certificate file and restart Claude Code. See the enterprise network settings.

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-code for stable or brew upgrade claude-code@latest for 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.

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

Native Windows. Open PowerShell under the account you used to install it.

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

Package 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
Related Articles
Claude Managed Agents on Amazon Bedrock and the Claude API

Claude Managed Agents on Amazon Bedrock and the Claude API

Choose between the Claude API and Amazon Bedrock, see who runs the tools and bills usage, and create an agent with Anthropic’s documented request.Dec 1, 2026Build
Harness Tuned for One Model, Run on Another: What Google's Papers Measured

Harness Tuned for One Model, Run on Another: What Google's Papers Measured

Google's Harness² papers, read closely: what happened when a harness met a new model, what carries over, and a first-week checklist for switching models.Dec 1, 2026Build
Claude Buddy: What Happened to the Terminal Pet?

Claude Buddy: What Happened to the Terminal Pet?

Why /buddy stopped working in Claude Code, what the maintainer said, and how to tell the terminal pet from Anthropic’s Desktop Buddy hardware project.Dec 1, 2026Build
NotebookLM MCP

NotebookLM MCP

Connect Claude Code to Google's NotebookLM MCP server. See who can use it, how to add sources, and which community tools can answer notebook questions.Dec 1, 2026Build
Grok Build TUI: How to bring your terminal work across

Grok Build TUI: How to bring your terminal work across

Which command brings your settings or sessions into Grok Build, how Cursor’s harness runs workflows, and what stays on your laptop when you steer from iOS.Dec 1, 2026Build
Claude Code CLI: How to Start and When to Use Desktop or VS Code

Claude Code CLI: How to Start and When to Use Desktop or VS Code

Install Claude Code in your shell, approve your first edit, and choose between the terminal, the desktop Code tab and the VS Code extension.Dec 1, 2026Build
Cursor to Grok Build: What Changes for Your Team

Cursor to Grok Build: What Changes for Your Team

Keep your editor, sessions and third-party models. See what the Agents Window beta adds and which Cursor mentions to change on December 7.Nov 30, 2026Build
Claude Ultracode

Claude Ultracode

Use Claude Code’s ultracode setting for one task, one session or every launch. See which jobs justify parallel agents and how to watch your plan usage.Nov 30, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.