Claude FastClaude Fast

Claude Code Installation: The Real Guide | Complete Setup Tutorial

Complete Claude Code installation guide with platform-specific solutions, troubleshooting, and community-tested fixes for Windows, macOS, and Linux.

Problem: You want to install Claude Code but don't know where to start. Here's the fastest path from zero to working AI terminal. See our complete guide for an overview of all Claude Code capabilities.

How to Install Claude Code: Quick Start

Install Claude Code in under 2 minutes with this command:

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

Success looks like: A version number displays without errors.

If that worked, skip to Troubleshooting. If not, follow your platform-specific steps below.

Step-by-Step: Install Claude Code on Any Platform

Before you install Claude Code, verify you have:

  1. Terminal access (Command Prompt, PowerShell, or Bash)
  2. An Anthropic API key from console.anthropic.com
  3. Node.js 18+ (only required for npm installation method)

Install Claude Code on Windows

Windows now supports multiple installation options. Choose the one that fits your workflow:

Option 1: Native Windows (Recommended)

# PowerShell (Run as Administrator)
irm https://claude.ai/install.ps1 | iex
claude --version

Option 2: Git Bash

Install Git for Windows, then:

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

Option 3: WSL (Ubuntu)

# Install WSL if needed (PowerShell as Administrator)
wsl --install -d Ubuntu
 
# Inside Ubuntu terminal
curl -fsSL https://claude.ai/install.sh | bash
claude --version

Windows users: The native installer no longer requires Node.js. WSL users should run Claude Code from their Linux terminal.

Install Claude Code on macOS

Option 1: Homebrew (Recommended)

brew install --cask claude-code
claude --version

Option 2: Native Installer

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

Option 3: npm (if you prefer Node.js)

npm install -g @anthropic-ai/claude-code
 
# If you see "command not found", fix PATH:
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
claude --version

Install Claude Code on Linux

Option 1: Native Installer (Recommended)

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

Option 2: Homebrew

brew install --cask claude-code
claude --version

Option 3: npm (requires Node.js 18+)

# Create user npm directory (prevents sudo requirements)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
 
# Install Claude Code
npm install -g @anthropic-ai/claude-code
claude --version

Configure Your API Key

After you install Claude Code successfully, configure authentication:

claude
# Paste your API key when prompted

Get your API key: Visit console.anthropic.com, create an account, navigate to API Keys, and generate a new key starting with sk-.

Verify Your Installation

Test your Claude Code installation:

claude --version    # Shows version number
claude doctor       # Runs diagnostics

Quick functionality test:

mkdir test-project && cd test-project
echo "console.log('Hello!');" > test.js
claude

In the Claude prompt: "Read test.js and explain it"

Success: Claude reads the file and explains the JavaScript code.

Common Errors When You Install Claude Code

Error: "Command Not Found"

Cause: PATH configuration missing after install

Fix:

which claude    # Check if installed
npm list -g @anthropic-ai/claude-code
 
# Add to PATH manually
echo 'export PATH="$PATH:/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin"' >> ~/.bashrc
source ~/.bashrc

Error: "EBADPLATFORM"

Cause: npm installation attempted on unsupported platform configuration

Fix: Use the native installer instead of npm:

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

Error: "EACCES Permission Denied"

Cause: npm requires sudo (insecure practice)

Fix: Configure user-level npm directory (see Linux section above). This works on all platforms.

Nuclear Reset (Fixes 95% of Issues)

When everything fails, reset completely:

npm uninstall -g @anthropic-ai/claude-code
rm -rf ~/.claude ~/.npm/_cacache
npm cache clean --force
npm install -g @anthropic-ai/claude-code
claude --version

What to Do After You Install Claude Code

Once claude --version works without errors:

  1. Build your first project: First Project Guide
  2. Learn the interface: What is Claude Code
  3. Configure settings: Configuration Basics
  4. Fix common problems: Troubleshooting Guide
  5. See real examples: Examples & Templates

Pro tip: Run claude doctor anytime something feels broken. It auto-detects most configuration issues and suggests fixes.

Last updated on