Skip to content

Installation & Setup

Get Claude Code running on macOS, Windows, or Linux in minutes.

Beginner8 min read

Claude Code is a CLI tool that runs in your terminal. Getting it installed and logged in takes about five minutes — this lesson walks you through exactly that.

Requirements

Before you install, make sure your machine qualifies. Claude Code needs a supported OS, enough RAM, a network connection, and a paid Anthropic account.

  • Operating system: macOS 13+, Windows 10 1809+ / Server 2019+, Ubuntu 20.04+, Debian 10+, or Alpine 3.19+
  • Hardware: 4 GB+ RAM, x64 or ARM64 processor
  • Network: a live internet connection (Claude Code calls Anthropic's servers for every request)
  • Account: a Claude Pro, Max, Team, Enterprise, or Anthropic Console subscription — the free Claude.ai plan does not include CLI access
  • Country: your location must be in an Anthropic-supported country (anthropic.com/supported-countries)

Install the CLI

The recommended method is the native installer — a single command that downloads the binary, adds it to your PATH, and sets up auto-updates. Pick the command for your platform:

bash
# macOS, Linux, or WSL
curl -fsSL https://claude.ai/install.sh | bash
powershell
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
batch
# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Prefer a package manager? Homebrew and WinGet are supported alternatives:

bash
# macOS — Homebrew
brew install --cask claude-code

# Windows — WinGet
winget install Anthropic.ClaudeCode
Homebrew and WinGet do not auto-update
The native installer keeps itself up to date automatically in the background. Homebrew and WinGet do not — you need to run 'brew upgrade claude-code' or 'winget upgrade Anthropic.ClaudeCode' manually to get new versions.
Windows: install Git for Windows for the best experience
On native Windows, Claude Code uses PowerShell to run shell commands by default. Installing Git for Windows (git-scm.com/downloads/win) also gives Claude Code access to Git Bash, which is useful for Bash-based scripts and tooling. WSL users do not need Git for Windows — just run the Linux installer inside your WSL terminal.

Authenticate

Once installed, navigate to any project folder and run 'claude'. Claude Code will open a browser window and ask you to log in with your Anthropic account. Follow the prompts — it takes about thirty seconds.

bash
cd your-project
claude
Browser did not open automatically?
Press 'c' at the login prompt to copy the OAuth URL to your clipboard, then paste it into a browser manually. This also works in SSH sessions or WSL where the browser opens on a different machine.

Verify your setup

After installation and login, confirm everything is working with two quick commands:

bash
# Check the installed version
claude --version

# Run a full diagnostic (checks auth, PATH, updates, and more)
claude doctor

If something goes wrong

Two issues account for the vast majority of post-install problems:

  • 'command not found: claude' — the install directory is not in your PATH. On macOS/Linux, add 'export PATH="$HOME/.local/bin:$PATH"' to your ~/.zshrc or ~/.bashrc, then restart your terminal. On Windows, add '%USERPROFILE%\.local\bin' to your User PATH in System Settings.
  • Install script returns HTML or a 403 error — your network or region may be blocking claude.ai. Try Homebrew ('brew install --cask claude-code') on macOS or WinGet ('winget install Anthropic.ClaudeCode') on Windows as an alternative, or retry on a different network.
  • 403 Forbidden after login — check that your subscription is active at claude.ai/settings. If you use the Anthropic Console, confirm your account has the 'Claude Code' or 'Developer' role.
Key takeaways
Install with the native one-liner for your platform, run 'claude' in your project to authenticate, and verify with 'claude --version' or 'claude doctor'. The native installer handles updates automatically; Homebrew and WinGet require manual upgrades. Full setup docs and a complete troubleshooting reference are at code.claude.com/docs/en/setup.