How to Install Claude Code

Install Claude Code with the current official setup paths, verify the CLI, authenticate safely, and avoid common first-day mistakes.

Install Claude Code from an official setup path, verify the claude command, then authenticate from the terminal where you will work. Do not rely on old npm-only tutorials without checking the current setup page.

Last checked on May 24, 2026. Claude Code has native installers, package manager options, and npm support. The official setup page is the source of truth for exact commands and supported platforms.

Short Answer

For most users, use the native installer recommended by the Claude Code docs. Homebrew, WinGet, apt, dnf, apk, and npm are also documented paths, but update behavior differs by method.

System Requirements

AreaCurrent practical requirement
OSmacOS 13+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+.
Hardware4 GB+ RAM, x64 or ARM64 processor.
ShellBash, Zsh, PowerShell, or CMD.
NetworkInternet access and supported country availability.
AccountPro, Max, Team, Enterprise, Console, or supported cloud-provider access. Free Claude does not include Claude Code.

Install Paths

Platform or preferenceCommand or pathNotes
macOS, Linux, WSL native installer`curl -fsSL https://claude.ai/install.shbash`
Windows PowerShell`irm https://claude.ai/install.ps1iex`
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdUse this in CMD, not PowerShell.
Homebrewbrew install --cask claude-codeStable cask; manual upgrade with brew upgrade claude-code.
Homebrew latestbrew install --cask claude-code@latestReceives new versions faster; manual upgrade required.
WinGetwinget install Anthropic.ClaudeCodeManual upgrade with winget upgrade Anthropic.ClaudeCode.
npmnpm install -g @anthropic-ai/claude-codeRequires Node.js 18+. Do not use sudo npm install -g.

Verify Installation

Run:

claude --version
claude doctor

If the command is not found, check your PATH, terminal restart, package manager install location, or conflicting old installations.

Authenticate

After installation, run:

claude

Follow the browser login flow. For terminal CLI sessions, credential precedence matters. Cloud provider settings, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, helper scripts, OAuth tokens, and subscription OAuth can all change how the session is billed. If you expect to use a subscription but have ANTHROPIC_API_KEY set, confirm /status before a long session.

First Project Checklist

  1. Open a small project directory, not your largest monorepo.
  2. Run claude.
  3. Ask for a read-only overview first.
  4. Add a concise CLAUDE.md with build, test, lint, and safety rules.
  5. Use Plan Mode before the first multi-file change.
  6. Review the diff before committing.

Official Sources