To install Claude Code, open a terminal and run a single 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 article follows Anthropic's official documentation, reviewed on October 31, 2026. It provides step-by-step installation instructions, log in, updates, and the most common errors.
How to install Claude Code in a few minutes
Installing Claude Code is done through a terminal. First, paste the command for your system. Next, wait for the download to complete, then open a new terminal and type claude. Finally, the first time you run it, Claude Code asks you to sign in via your browser. Furthermore, the installer recommended by Anthropic is the native installation, which updates automatically in the background.
Here is the sequence of steps, from start to finish. The diagram below summarizes them with the exact commands covered in the rest of the article.
What you need before installing Claude Code
The official installation page sets out the following requirements.
| Item | What the documentation states |
|---|---|
| Operating system | macOS 13.0 or higher; Windows 10 version 1809 or higher, or Windows Server 2019 or higher; Ubuntu 20.04 or higher; Debian 10 or higher; Alpine Linux 3.19 or higher |
| Hardware | At least 4 GB of RAM, x64 or ARM64 processor |
| Network | An internet connection is required |
| Shell | Bash, Zsh, PowerShell, or CMD |
| Country | Your country must be included in the list of supported countries by Anthropic |
| Account | A Pro, Max, Ultra, Team, or Enterprise subscription, or a Console account. The free claude.ai plan does not provide access to Claude Code |
Indeed, for the native installation, the documentation does not require Node.js or a version manager like nvm. Node.js 22 or newer is only required if you choose the npm installation, discussed below. However, in both cases, never use sudo npm install -g: the documentation advises against it.
A word on pricing. Subscription prices change, and we do not reproduce them here. Therefore, check the Claude pricing page directly before choosing a plan.
Installing Claude Code on macOS and Linux
Open Terminal, paste this command, then press Enter:
curl -fsSL https://claude.ai/install.sh | bash
It also works on Linux and in WSL. Next, the download displays no progress bar: this is normal, wait until the prompt returns. Then close the window, open a new terminal, and run:
claude --version
A version number followed by "(Claude Code)" confirms that everything is in place. On the other hand, if your shell reports that claude cannot be found, see the troubleshooting section below.
Homebrew and Linux package managers
If you prefer Homebrew, the documentation suggests:
brew install --cask claude-code
Homebrew offers two casks. On one hand, the claude-code cask follows the stable channel, generally about a week behind the latest release. On the other hand, the claude-code@latest cask receives new features as soon as they are released. However, a Homebrew installation does not update automatically: you need to run brew upgrade claude-code or brew upgrade claude-code@latest, depending on the chosen cask.
On Debian, Fedora, RHEL, and Alpine, Anthropic also publishes signed apt, dnf, and apk repositories. The complete commands, along with the signing key, can be found in the dedicated documentation section. We do not copy them here, as they involve multiple steps that the official guide details more effectively.
Alpine Linux
Alpine does not include bash or curl by default. As a result, the installation command fails as long as they are missing. The documentation instructs to install the necessary packages with:
apk add bash curl libgcc libstdc++ ripgrep
It then additionally requires setting USE_BUILTIN_RIPGREP to 0 in Claude Code's settings.json file.
Installing Claude Code on Windows
Windows offers two paths: native installation and installation in WSL. The documentation compares them as follows.
| Option | Prerequisites | Sandboxing | When to choose it |
|---|---|---|---|
| Native Windows | None, Git for Windows is optional | Not supported | Windows-specific projects and tools |
| WSL 2 | WSL 2 enabled | Supported | Linux tools or sandboxed command execution |
| WSL 1 | WSL 1 enabled | Not supported | Only if WSL 2 is unavailable |
Native Windows: PowerShell or CMD
You do not need to run the terminal as an administrator. However, identify your window before copying a command: the prompt displays PS C:\ in PowerShell, and simply C:\ in CMD. In PowerShell:
irm https://claude.ai/install.ps1 | iex
In CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The classic trap is pasting the PowerShell command into CMD, or vice versa. In CMD, irm is not recognized. In PowerShell, the && token triggers the error "The token '&&' is not a valid statement separator". The troubleshooting documentation points out the same thing: you copied the command for a different shell. Check your prompt, then run the correct command.
There is also a WinGet variant: winget install Anthropic.ClaudeCode. However, it does not update automatically; you need to run winget upgrade Anthropic.ClaudeCode from time to time.
Git for Windows remains optional. Indeed, without it, Claude Code executes its commands via PowerShell. With it, it uses Git Bash.
Windows with WSL
If you prefer WSL, open your Linux distribution and run the Linux command, the one with install.sh. Then, install and start claude from the WSL terminal, not from PowerShell or CMD. Furthermore, the official page assumes WSL is already enabled: it does not cover enabling it, and we do not invent any commands here. If you are looking for how to install WSL, start from the Microsoft documentation.
Claude Code or Claude Desktop: do not confuse them
Two products share similar names. First, Claude Code is the command-line tool described above. Second, the Claude Desktop application is a graphical application that brings together Chat, Cowork, and Claude Code. The documentation also notes that it allows you to use Claude Code without the terminal.
On Linux, the desktop application is in beta. Furthermore, it requires a Debian-based distribution: Ubuntu 22.04 or higher, or Debian 12 or higher, in x86_64 or arm64. On Fedora or Arch, the documentation points to the CLI. So, if you are looking for Claude Desktop for Linux, the official answer is the beta app on Debian or Ubuntu, and the CLI everywhere else.
There is one detail for Windows users. An older version of Claude Desktop may register a Claude.exe that takes precedence over the CLI: the claude command then opens the desktop application instead of the terminal. To fix this, the documentation advises updating Claude Desktop to resolve this behavior.




