installation guide getting-started

How to Install Claude Code: Complete Guide 2026

The definitive guide to installing Claude Code on any platform. Learn native install, Homebrew, WinGet, and npm methods with step-by-step instructions.

Updated: February 1, 2026 8 min read

What is Claude Code?

Claude Code is an agentic AI coding tool built by Anthropic that operates directly in your terminal. Unlike traditional code assistants that only suggest completions, Claude Code understands your entire codebase, writes production-ready code, and can ship features autonomously.

In this guide, we’ll walk through every installation method available so you can get started in minutes.

Prerequisites

Before installing, make sure your system meets these requirements:

  • Operating System: macOS 13.0+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+
  • RAM: 4 GB minimum
  • Network: Active internet connection
  • Shell: Bash or Zsh recommended
  • Location: Must be in an Anthropic supported country

The native installer is the recommended method for all platforms. It provides automatic background updates and the best experience.

macOS & Linux

Open your terminal and run:

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

That’s it! The binary installs to ~/.local/bin/claude and auto-updates in the background.

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

Method 2: Homebrew (macOS)

If you prefer Homebrew:

brew install --cask claude-code

Note: Homebrew installations do not auto-update. Run brew upgrade claude-code periodically to stay current.

Method 3: WinGet (Windows)

winget install Anthropic.ClaudeCode

Like Homebrew, WinGet installations don’t auto-update. Use winget upgrade Anthropic.ClaudeCode for updates.

Method 4: npm (Deprecated)

npm install -g @anthropic-ai/claude-code

Warning: npm installation is deprecated. If you have an existing npm install, migrate to native by running claude install.

Never use sudo npm install -g — this causes permission issues and security risks.

Verify Your Installation

After installing, verify everything is working:

claude --version

Run the built-in health check:

claude doctor

This checks your installation type, version, connectivity, and configuration.

Authentication

Claude Code requires authentication. You have several options:

Subscribe to a Claude Pro or Max plan for a unified subscription that includes both Claude Code and Claude on the web. Log in with your Claude.ai account.

Option 2: Anthropic Console

Connect through the Anthropic Console and complete the OAuth process. Requires active billing.

Option 3: Cloud Providers

For enterprise deployments, configure Claude Code with Amazon Bedrock, Google Vertex AI, or Microsoft Foundry.

Your First Session

Navigate to your project and launch:

cd your-awesome-project
claude

Claude Code will analyze your codebase and be ready to help you build, debug, and ship.

Updating Claude Code

Native installations auto-update. For manual updates:

claude update

For Homebrew: brew upgrade claude-code

For WinGet: winget upgrade Anthropic.ClaudeCode

Troubleshooting

Command not found

Make sure ~/.local/bin is in your PATH:

export PATH="$HOME/.local/bin:$PATH"

Add this to your ~/.bashrc or ~/.zshrc for persistence.

Permission errors

Never use sudo with npm installs. If you encounter permission issues, use the native installer instead.

Installation on Alpine Linux

Alpine requires additional dependencies:

apk add libgcc libstdc++ ripgrep

What’s Next?

Not working?

Check common errors and instant fixes in the Error Fix Center.

Fix Errors →