Beginner 14 minIDE

Installing Claude Code on Windows, Mac, and Linux

An open laptop casts green light across a dark desk.
Direct response

To install Claude Code, run Anthropic's official command in a terminal: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, or irm https://claude.ai/install.ps1 | iex in PowerShell on Windows. Then verify with claude --version, and type claude to sign in. You need a paid Claude subscription or a Console account: the free plan does not include Claude Code.

Claude Code installs with a single command on Windows, macOS, and Linux, but the details vary from one system to another: PowerShell or CMD, WSL, Homebrew, Linux repositories, PATH fixes. This guide gives you the official commands as of November 18, 2026, how to verify that everything works, the most common errors, and finally how to connect it to a local model with Ollama.

By Mohamed Meguedmi·Update 2026-11-20·Tested on Windows 11

#How do you install Claude Code? Requirements and official commands

Claude Code installs with a single official command: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, and WSL, or irm https://claude.ai/install.ps1 | iex in PowerShell on Windows. This native script is the method Anthropic recommends, because it updates itself automatically in the background.

Claude Code is Anthropic's coding agent: a program you use in the terminal that reads a project's code, edits files, and runs commands once you approve. The program installs on your machine, but the AI model runs on Anthropic's servers: according to the official documentation as of November 18, 2026, an internet connection is required.

Claude Code installation methods by operating system (Anthropic documentation, November 18, 2026)
SystemMethodCommandeAutomatic updates
macOS, Linux, WSLNative script (recommended)curl -fsSL https://claude.ai/install.sh | bashYes, in the background
Windows (PowerShell)Native script (recommended)irm https://claude.ai/install.ps1 | iexYes, in the background
Windows (CMD)Native scriptcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdYes, in the background
macOSHomebrewbrew install --cask claude-codeNot by default: brew upgrade claude-code
WindowsWinGetwinget install Anthropic.ClaudeCodeNot by default: winget upgrade Anthropic.ClaudeCode
Debian, Ubuntu, Fedora, RHEL, AlpineSigned apt, dnf, and apk repositoriesSee the official documentationNo: system update
All (Node.js 22 or later)npmnpm install -g @anthropic-ai/claude-code@latestDepending on npm folder permissions

#Requirements

The complete kit for making the most of local AI on your Mac.

Benefit from our experience and a guided path to choose the right tools for your Mac and use your AI every day.

  • Lifetime online access
  • PDF + files
  • Refunded within 30 days
System
macOS 13.0 or later, Windows 10 1809 or later (or Windows Server 2019), Ubuntu 20.04 or later, Debian 10 or later, Alpine Linux 3.19 or later.
Hardware
At least 4 GB of RAM and an x64 or ARM64 processor. No graphics card is needed, since the Claude model runs remotely.
Compte
A Claude Pro, Max, Ultra, Team, or Enterprise subscription, or a pay-as-you-go Claude Console account. The free claude.ai plan does not include Claude Code.
Country
Claude Code is only available from countries supported by Anthropic; France is one of them.

On pricing, Anthropic's official page, checked on November 18, 2026, lists the Pro plan at $20 per month with monthly billing, and states that Claude Code is included in all paid plans, with the same usage limits as the rest of the subscription. Plan details and free alternatives are covered in the dedicated guide to Claude Code pricing.

#Install Claude Code on Windows: PowerShell, CMD, or WSL

On Windows, Claude Code installs from PowerShell with irm https://claude.ai/install.ps1 | iex, without administrator rights. Alternatively, you can install it in WSL 2, the Windows Subsystem for Linux, using the Linux command: it's the only Windows setup where the command sandbox is supported.

  1. 01
    Open PowerShell
    Open the Start menu, type PowerShell, and launch it normally, without “Run as administrator.” The prompt starts with PS C:\Users\VotreNom>, which confirms you're in PowerShell and not in the CMD command prompt.
  2. 02
    Run the install script
    Paste the command irm https://claude.ai/install.ps1 | iex and press Enter. The script downloads Claude Code without showing a progress bar: wait for the prompt to return before doing anything else.
  3. 03
    Open a new terminal
    Close the PowerShell window and open a new one so the install folder is picked up. The program is installed at %USERPROFILE%\.local\bin\claude.exe.
  4. 04
    Check the version
    Type claude --version. A successful installation displays a version number followed by (Claude Code). If Windows says claude is not recognized, apply the PATH fix described below.
  5. 05
    Install Git for Windows (recommended)
    Git for Windows is optional but recommended by Anthropic: it provides Git Bash, which Claude Code uses to run its commands. Without it, Claude Code falls back to PowerShell. An installation in WSL doesn't need it.
Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
Windows (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Windows (WinGet)
winget install Anthropic.ClaudeCode
→
WSL 2 or native Windows?
Choose native Windows for Windows projects and tools. Choose WSL 2 if your projects use Linux tools or if you want the command sandbox, which Anthropic's documentation says isn't supported on native Windows or on WSL 1. In WSL, install and run claude from the WSL terminal, not from PowerShell.

#Installing Claude Code on Mac: native script or Homebrew

On a Mac, you install Claude Code by opening the Terminal app and running curl -fsSL https://claude.ai/install.sh | bash. It requires macOS 13.0 or later; both Apple Silicon Macs (ARM64) and Intel Macs (x64) are supported. Homebrew is an alternative, but without automatic updates.

macOS (Terminal, native script)
curl -fsSL https://claude.ai/install.sh | bash
macOS (Homebrew)
brew install --cask claude-code

Homebrew offers two Claude Code packages. The claude-code package follows the stable channel, which is generally about one week behind and skips releases with major regressions. The claude-code@latest package gets every release as soon as it ships. By default, you update via Homebrew manually with brew upgrade claude-code, or brew upgrade claude-code@latest for the second package. To have Claude Code run this Homebrew or WinGet update itself, Anthropic's documentation says to set the CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE environment variable to 1.

The native script puts the launcher in ~/.local/bin/claude. If Terminal responds with "command not found: claude", that directory isn't in your shell's PATH yet: the fix is in the troubleshooting section.

#Installing Claude Code on Linux: script, apt, dnf, or Alpine

On Linux, Claude Code installs with the same script as on Mac: curl -fsSL https://claude.ai/install.sh | bash, without sudo. Anthropic also publishes signed apt (Debian, Ubuntu), dnf (Fedora, RHEL), and apk (Alpine) repositories for machines where software has to go through the package manager.

Linux (Ubuntu, Debian, Fedora…)
curl -fsSL https://claude.ai/install.sh | bash

Alpine Linux and other musl-based distributions don't include bash or curl by default. Without them, the install script fails with a "not found" error. Install those two packages first, then rerun the install command.

Linux (Alpine)
apk add bash curl

The apt, dnf, and apk repositories each offer a stable channel and a latest channel. Setting them up takes several commands, including verifying the fingerprint of Anthropic's signing key: follow them directly on the advanced installation page of the official documentation, linked at the end of this guide. These installations update along with the system, for example sudo apt update && sudo apt upgrade claude-code.

!
Installing with npm: never with sudo
The npm method requires Node.js 22 or later. Anthropic's documentation explicitly advises against sudo npm install -g, which causes permission issues and security risks, and notes that an install that needs sudo can't update itself. The native script avoids this problem.
macOS, Linux, Windows (npm, Node.js 22+)
npm install -g @anthropic-ai/claude-code@latest

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

To verify your Claude Code installation, open a new terminal and type claude --version: a version number should appear. As of November 18, 2026, the latest version at the top of the official changelog is 2.1.327, while the stable channel distributes 2.1.311 according to the npm registry. So an older number isn't necessarily an error: the claude-code Homebrew package and the Linux repositories configured by default follow this stable channel. The claude doctor command then gives you a full diagnostic.

macOS, Linux, Windows
claude --version
claude doctor

The claude doctor command shows, without opening a session, the installation status, errors in settings files, and warnings with a suggested fix. It's the first thing to try when Claude Code behaves oddly after an install or update.

  1. 01
    Open a project
    In the terminal, go to the folder of the project you want to work on using the cd command followed by the folder path. Claude Code works on the files in the folder where it is launched.
  2. 02
    Launch Claude Code
    Type claude. On first launch, Claude Code opens your browser so you can sign in with your Claude account (Pro, Max, Ultra, Team, Enterprise) or your Console account. If the browser shows a code instead of returning to the terminal, paste that code into the terminal.
  3. 03
    Ask a first question
    Once you're signed in, the Claude Code prompt shows the version, the model, and the working directory. Try asking something like "what does this project do?" Your credentials are saved, so you won't be asked to sign in again on later launches.
  4. 04
    Prepare the project
    Type /init to have Claude Code analyze the codebase and generate a starter CLAUDE.md file with the project's build and test commands and conventions. Type /help for the list of commands and /config for settings.

#Updating or uninstalling Claude Code

A native install of Claude Code updates itself at startup and in the background; the claude update command applies the latest version right away. For a native install on macOS, Linux, or WSL, uninstalling means deleting the launcher and the versions folder.

macOS, Linux, WSL (native uninstall)
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

#Claude Code not found or installation blocked: common errors

The most common error after installing Claude Code is "command not found: claude" or "'claude' is not recognized": the program is installed correctly, but its folder, ~/.local/bin on Mac and Linux or %USERPROFILE%\.local\bin on Windows, isn't in your PATH. The installer flags this in its "Setup notes" but doesn't fix the PATH itself.

Claude Code installation errors and fixes (Anthropic troubleshooting guide, November 18, 2026)
Displayed messageCausePatch
command not found: claude / 'claude' is not recognizedInstall folder missing from PATHAdd ~/.local/bin (or %USERPROFILE%\.local\bin) to your PATH, then open a new terminal
The token '&&' is not a valid statement separatorCMD command pasted into PowerShellUse the PowerShell command
'irm' is not recognized as an internal or external commandPowerShell command pasted into CMDUse the CMD command
curl: (22) The requested URL returned error: 403Proxy or network filter, or unsupported countryCheck the company network or proxy
App unavailable in regionCountry not supported by AnthropicClaude Code isn't available in this country
not found on Alpinebash ou curl absentsapk add bash curl
macOS (zsh): add ~/.local/bin to your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Windows (PowerShell): add the folder to the user PATH
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

The zsh fix applies to macOS, where zsh is the default shell. On Linux with bash, add the same export line to ~/.bashrc; on a Mac with bash, it goes in ~/.bash_profile, because the macOS Terminal launches bash as a login shell, which ignores ~/.bashrc. A terminal opened before the fix keeps the old PATH, and a terminal built into an editor such as VS Code inherits the editor's PATH: close and reopen the window, or the editor, before testing claude --version again.

#How do you connect Claude Code to VS Code?

To use Claude Code in VS Code, install Anthropic's official Claude Code extension: open the Extensions view with Cmd+Shift+X on Mac or Ctrl+Shift+X on Windows and Linux, search for "Claude Code," and click Install. You need VS Code 1.94.0 or later and a paid Claude account or a Console account.

The Claude Code VS Code extension bundles its own copy of the program for its chat panel, but doesn't add it to your PATH. To type claude in VS Code's integrated terminal, you still need the standalone installation described above. The extension also installs in Cursor and other VS Code-based editors through the Open VSX registry.

i
No terminal: the desktop app
Anthropic's documentation also offers the Claude desktop app for using Claude Code without a terminal, on macOS, Windows, and Linux (beta on Linux). It requires the same sign-in with a paid Claude account.

#Connecting Claude Code to a local model with Ollama

Claude Code can work with a local model through Ollama, which exposes an Anthropic-compatible API. Once Claude Code and Ollama are installed, the ollama launch claude command starts Claude Code connected to Ollama. The Ollama documentation recommends a local model configured with a context of 64k tokens or more.

macOS, Linux, Windows (Ollama installed)
ollama launch claude

Ollama's documentation also describes a manual setup using environment variables, which points Claude Code to the local Ollama server on port 11434. The official example uses the qwen3.5 model, whose default tag in the Ollama library corresponds to the 9B version, at 6.6 to 7.6 GB; a model must support tool calling for Claude Code to be able to read and edit files.

macOS, Linux (Bash or Zsh)
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434
claude --model qwen3.5
!
Configuration not supported by Anthropic
The Claude Code documentation states that Anthropic does not support using Claude Code with non-Claude models through a gateway. Connecting to Ollama works according to Ollama's documentation, but any issue is a matter for Ollama, not Anthropic support. Quality depends heavily on the local model and the available memory.
Frequently asked questions
Is Claude Code free?+
The Claude Code program is free to install, but using it with Claude models requires a paid subscription (Pro, Max, Ultra, Team, Enterprise) or a pay-as-you-go Console account. According to Anthropic's documentation as of November 18, 2026, the free claude.ai plan does not include Claude Code. Connecting to a local model via Ollama replaces Claude models with a model on your machine, outside Anthropic's support.
Do you need Node.js to install Claude Code?+
No, Node.js is no longer required to install Claude Code with the native script, Homebrew, WinGet, or the Linux repositories. Only the npm method requires Node.js 22 or later, and the documentation specifies that the installed program is a native binary that does not use Node.js at runtime. The native script remains the recommended method.
Do you need administrator rights to install Claude Code on Windows?+
No. Anthropic's documentation states that the Claude Code install command runs from PowerShell or CMD without running the terminal as administrator. The program installs in the user folder, under %USERPROFILE%\.local\bin.
How do you install a plugin in Claude Code?+
In a Claude Code session, the /plugin command opens a panel listing the plugins from the configured marketplaces, and /plugin install followed by the name and marketplace, for example commit-commands@claude-plugins-official, opens the plugin's details page before installation. Anthropic's documentation points out that a plugin can run hooks and MCP servers: read its details page before installing it.
How should you configure Claude Code after installing it?+
After installing Claude Code, run /init in your project to generate a CLAUDE.md file that describes the build and test commands and the conventions. You can change settings with /config or in the ~/.claude/settings.json file. The claude doctor command reports invalid settings files and installation problems.
Does Claude Code work offline?+
No. Anthropic's documentation states that an internet connection is required to use Claude Code, because Claude models run on Anthropic's servers. With Ollama and a local model, requests to the model stay on your machine, but Anthropic's documentation does not describe fully offline operation: treat this as not guaranteed.
How do you update Claude Code?+
A native Claude Code installation updates itself, at startup and in the background, and claude update forces an immediate update. By default, Homebrew, WinGet, apt, dnf, and apk installations do not update themselves: use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your Linux system update. For Homebrew and WinGet, the CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 variable hands this update over to Claude Code.

#Sources and verification as of November 18, 2026

The commands, requirements, versions, and prices in this guide were collected on November 18, 2026, from the official Claude Code documentation, Anthropic's pricing page, the changelog in Anthropic's GitHub repository, and the Ollama documentation; commands and prices change often, so verify them before an enterprise deployment.

Did this guide help you?

Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.