How to Install Claude Code on Mac, Windows, and Linux (2026 Guide)

What it is: The official install guide for Claude Code, Anthropic’s AI coding assistant. Covers every supported platform — macOS, Windows (PowerShell, CMD, WinGet), Linux (apt/dnf/apk), Homebrew, WSL — with exact commands, prerequisites, troubleshooting, and first-run authentication.
Who it is for: Anyone trying to get Claude Code running on their machine in under five minutes.
Best if: You want commands you can paste and have working in one shot.
Skip if: You don’t have a Claude subscription yet — start with our Claude Code overview. For one issue per day on what just shipped in AI, subscribe to our free daily newsletter.

1-on-1 Coaching

Claude AI Crash Course

1-hour private video session with James. Install Claude Code together, configure CLAUDE.md for your stack, add the MCP servers you actually need, and walk through your first real task — live, in your project. You leave with a working setup that ships code, not just an install.

$75

1-hour live

Book session →

Group Format

AI Workshops for Engineering Teams

Team-format Claude Code rollouts: onboarding, CLAUDE.md templates per stack, permission-mode policy, MCP server inventory, and safe-by-default config. Best for 3+ engineers standardizing on Claude Code.

Custom

pricing

Get a quote →

What is the fastest way to install Claude Code?

One line in your terminal. The exact command depends on your OS:

OSRecommended command
macOS, Linux, WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

After install, run claude in any project directory, log in once via the browser-based flow, and start coding. Native installations auto-update in the background. Total time from zero to first task: under five minutes.

What do you need before installing Claude Code?

  • A terminal or command prompt. macOS Terminal, iTerm, Windows Terminal, PowerShell, CMD, or any Linux shell.
  • An internet connection. Claude Code calls the Claude API in real time and can’t run offline.
  • A Claude account. Either a paid Claude subscription (Pro, Max, Team, or Enterprise), an Anthropic Console account with API credits, or access through a supported cloud provider (Amazon Bedrock, Google Vertex AI, Microsoft Foundry).
  • A code project to work in. Any directory containing source files. Empty directory is fine for new projects.

The free Claude tier does not include Claude Code — you need at least Claude Pro ($17/month annual or $20/month monthly). For a deeper plan comparison see our Claude Code pricing breakdown.

How do you install Claude Code on macOS?

Option 1: Native installer (recommended). Open Terminal and run:

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

The native install places the claude binary in ~/.local/bin (or similar, depending on your shell config) and auto-updates in the background.

Option 2: Homebrew. If you prefer Homebrew for everything:

brew install --cask claude-code

Homebrew has two casks: claude-code tracks the stable release channel (typically about a week behind, skips releases with major regressions), and claude-code@latest tracks the latest channel. Homebrew installs do not auto-update — run brew upgrade claude-code periodically to stay current.

Verify the install:

claude --version
# Should print something like: claude-code 1.x.x

How do you install Claude Code on Windows?

Three install paths on native Windows. PowerShell is recommended for most users.

Option 1: PowerShell. Open Windows Terminal or PowerShell (your prompt will show PS C:\):

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

Option 2: CMD. If you’re in plain Command Prompt (no PS in front of C:\):

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

Option 3: WinGet (Windows Package Manager).

winget install Anthropic.ClaudeCode

Note: WinGet installs do not auto-update. Run winget upgrade Anthropic.ClaudeCode periodically.

Install Git for Windows first if you don’t already have it: git-scm.com/downloads/win. Without Git for Windows, Claude Code uses PowerShell as the shell tool, which works but limits some workflows that expect a Bash-compatible environment. WSL installs do not need Git for Windows.

How do you install Claude Code on Linux?

Option 1: Native installer (recommended). Same one-liner as macOS:

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

Option 2: Package managers. Native packages are available for the major distros:

  • Debian / Ubuntu (apt): follow the official setup docs to add Anthropic’s package repository and run sudo apt install claude-code
  • Fedora / RHEL (dnf): add the repo and run sudo dnf install claude-code
  • Alpine (apk): apk add claude-code after adding the repo

The exact repository-add commands change occasionally as Anthropic adjusts signing keys; reference the official setup docs for the current package-manager commands.

How do you install Claude Code in WSL (Windows Subsystem for Linux)?

WSL is the recommended path for Windows developers who want a Linux-native shell experience. Open your WSL distro (Ubuntu, Debian, etc.) and run the standard Linux installer:

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

You don’t need Git for Windows in WSL — the Linux side has its own Git via your distro’s package manager. Claude Code installed in WSL operates on files inside your WSL filesystem and can also reach into Windows-side files via the /mnt/c/ mount path if needed.

How do you log in to Claude Code on first run?

The first time you run claude, you’ll be prompted to log in:

cd /path/to/your/project
claude
# Browser opens for authentication
# Log in with your Claude account
# Approve the device authorization
# Return to terminal — you're in.

You can log in with any of these account types:

  • Claude Pro, Max, Team, or Enterprise subscription (recommended for most developers).
  • Anthropic Console account — pay-as-you-go API access with pre-paid credits. On first login, a “Claude Code” workspace is automatically created in the Console for centralized cost tracking.
  • Cloud provider account — Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Right path if your organization already routes AI spend through one of these providers.

Credentials are stored locally; you won’t need to log in again on the same machine until your token expires. Use /login inside Claude Code at any time to switch accounts.

How do you authenticate with an API key instead of subscription?

If you’re using Anthropic Console (API) billing instead of a subscription, set the ANTHROPIC_API_KEY environment variable before running Claude Code:

# macOS / Linux / WSL
export ANTHROPIC_API_KEY=sk-ant-...

# Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk-ant-..."

# Windows CMD
set ANTHROPIC_API_KEY=sk-ant-...

Make the variable persistent across sessions by adding it to your shell’s startup file (~/.bashrc, ~/.zshrc, PowerShell $PROFILE, or the Windows System Environment Variables panel). Generate your key in the Anthropic Console at console.anthropic.com → API Keys.

API-key auth is the right choice for: CI/CD pipelines, Docker containers, scripted automations, and teams who want metered cost tracking per API key. Subscription auth (the default after running claude and logging in via browser) is the right choice for: most individual developers, machines you use interactively, and anyone who doesn’t want to think about token-by-token billing.

How do you set up Claude Code with AWS Bedrock, Vertex AI, or Microsoft Foundry?

Enterprise customers who route AI spend through a cloud provider can authenticate Claude Code through that provider instead of using a direct Anthropic subscription or API key:

  • AWS Bedrock: Set CLAUDE_CODE_USE_BEDROCK=1 and the standard AWS credentials environment variables (or use your AWS CLI profile). Region and model are configured via AWS_REGION and ANTHROPIC_MODEL.
  • Google Vertex AI: Set CLAUDE_CODE_USE_VERTEX=1 and authenticate with gcloud auth application-default login. Configure project and region via ANTHROPIC_VERTEX_PROJECT_ID and CLOUD_ML_REGION.
  • Microsoft Foundry (Azure): Use the Foundry-specific config variables documented in Anthropic’s setup docs. Auth uses standard Azure CLI credentials.

This routes every Claude API call through your cloud provider’s billing instead of through claude.com or console.anthropic.com. Useful for organizations that want all AI usage to appear on the same cloud invoice, or that require model traffic to stay inside their cloud tenant for compliance reasons.

How do you verify the install worked?

Three quick checks:

  1. Version check: claude --version should print a version string.
  2. Help check: claude --help should print the help screen.
  3. Real task: cd into any project directory, run claude, then ask what does this project do? — Claude should respond with a summary of the codebase.

If all three work, you’re installed correctly. Continue with the official quickstart guide for your first tasks.

What are the most common install errors and how do you fix them?

Error: The token '&&' is not a valid statement separator
You’re in PowerShell, not CMD. The double-ampersand syntax is CMD-specific. Use the PowerShell command instead: irm https://claude.ai/install.ps1 | iex.

Error: 'irm' is not recognized as an internal or external command
You’re in CMD, not PowerShell. irm is the PowerShell alias for Invoke-RestMethod. Use the CMD command instead: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd.

Error: command not found: claude after install
The installer placed claude in a directory that’s not in your PATH. Restart your terminal first — the installer usually amends your shell config and the new PATH takes effect on next shell start. If that doesn’t work, check ~/.local/bin on Linux/macOS or the AppData directory on Windows, and add it to your shell’s PATH manually.

Error: SSL certificate or curl failure
Some corporate networks intercept HTTPS. Verify with curl -v https://claude.ai; if you see certificate warnings, the issue is your network’s MITM proxy. Workarounds: install from a personal network, or have IT add the install URL to the allowlist.

Error: Authentication failed after browser login
Usually a stale token. Run /login inside Claude Code or delete the credential file at ~/.config/claude/credentials.json (Linux/macOS) and try again.

How do you update Claude Code to the latest version?

  • Native install: updates automatically in the background. No action needed.
  • Homebrew: brew upgrade claude-code (or claude-code@latest).
  • WinGet: winget upgrade Anthropic.ClaudeCode.
  • apt / dnf / apk: use your distro’s standard upgrade command (e.g., sudo apt upgrade claude-code).

To force-check for an update inside Claude Code, run /upgrade in an interactive session.

How do you uninstall Claude Code?

Reverse the install method you used:

  • Native install: delete the claude binary from ~/.local/bin (or wherever it was placed) and remove any PATH amendment your shell config picked up. Optional: delete ~/.config/claude/ to remove cached credentials and settings.
  • Homebrew: brew uninstall --cask claude-code
  • WinGet: winget uninstall Anthropic.ClaudeCode
  • apt: sudo apt remove claude-code

Your Claude subscription remains active regardless of whether Claude Code is installed locally. Cancel the subscription separately at claude.com/billing if that’s also intended.

Frequently asked questions

Does Claude Code work on Apple Silicon (M1/M2/M3/M4) Macs?
Yes, natively. The native installer detects your architecture and pulls the right binary. No Rosetta required.

Does Claude Code work on ARM Linux (Raspberry Pi, etc.)?
The native installer supports x86_64 and arm64. Pi 4 and Pi 5 (arm64 Debian/Ubuntu) work; 32-bit ARM is not officially supported.

Can I install Claude Code without admin / sudo privileges?
Yes — the native installer installs to your user directory, no admin required. The system-wide package-manager installs (apt, dnf) need sudo. WinGet and Homebrew can be configured for user-only installs.

Does Claude Code need Node.js or Python installed first?
No. The native installer ships a self-contained binary with no runtime dependencies. Older Claude Code installer paths (via npm/pip) existed but the native installer is now the canonical path.

How big is the Claude Code install?
The CLI binary is roughly 60–90 MB depending on your platform. Add a few hundred MB for cached model context, local config, and conversation history once you start using it.

Can I install Claude Code on multiple machines with one subscription?
Yes. Claude Pro and Max allow concurrent use across multiple machines. Run /login on each one with the same account.

Does Claude Code work in Docker containers?
Yes, but you need to handle authentication. Either bind-mount your ~/.config/claude into the container, or use API-key auth via the ANTHROPIC_API_KEY environment variable in the container.

Can I install Claude Code in GitHub Codespaces or other cloud dev environments?
Yes — the standard Linux install works inside Codespaces, GitPod, Replit, and similar. For long-lived environments, configure API-key auth so the dev container doesn’t have to do an interactive browser login on every cold start.

How do I install Claude Code in an offline / air-gapped environment?
Not officially supported — Claude Code requires internet access to call the Claude API. Some enterprise environments use Bedrock or Vertex AI through a corporate gateway as a workaround.

Where does Claude Code store my conversation history?
Locally in your user config directory. On macOS/Linux: ~/.config/claude/. On Windows: %APPDATA%\Claude\. Delete the directory to wipe local history; Anthropic also retains conversation metadata server-side per your account’s data-retention settings.

Can I install a specific older version of Claude Code?
Yes, via package managers that retain older versions (Homebrew with brew install claude-code@1.2.3 if available; apt with version-pinned package). The native installer always pulls the latest stable.

How do I install Claude Code in a corporate environment with a proxy?
Set the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables before running the installer. Claude Code itself respects these proxy variables for all API calls. If your corporate proxy intercepts HTTPS with a custom CA, also set NODE_EXTRA_CA_CERTS or your platform’s equivalent so the install script can validate the download.

Can I install Claude Code for an entire team at once?
For individual machines, each developer runs the installer locally. For managed fleets, package the install through your existing tooling: a JAMF policy on macOS, an MDM script on Windows, or a configuration management tool like Ansible/Puppet/Chef on Linux. The native installer is scriptable and supports unattended installs.

Does Claude Code update automatically?
Native installs auto-update silently in the background. Package-manager installs (Homebrew, WinGet, apt) do not auto-update — run your package manager’s upgrade command on whatever cadence you prefer. The recommendation is to update at least monthly to pick up security fixes and new features.

What comes after the install?

Three high-leverage next steps:

  1. Read our Claude Code overview for the full feature surface and command reference.
  2. Create a CLAUDE.md file in your project root. This single file tells Claude Code your stack, conventions, and rules — the highest-leverage configuration you can do. See advanced workflows for design patterns.
  3. Pick one real task you’d do anyway and ship it with Claude Code. The fastest path to fluency is shipping one real feature with it.

Get every Claude Code update in one daily email

Anthropic ships meaningful Claude Code updates every couple weeks — new commands, new install paths, new auth options. The Beginners in AI newsletter ships one issue every day covering what just shipped across AI. Free, daily, no fluff.

Sources

Related news

Two ways to go further

The AI Prompt Library

1,000+ ready-to-use prompts for Claude, ChatGPT, and Gemini. Stop staring at a blank box.

Get it for $39 →

2-Hour Live AI Crash Course

A private, beginner-friendly session across Claude, ChatGPT, Gemini, and the wider landscape.

Book for $125 →

Discover more from Beginners in AI

Subscribe now to keep reading and get access to the full archive.

Continue reading