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.
Get Claude Code running in 2 minutes. Copy these commands, paste, and you're coding with AI.
Quick Start: One command gets you 90% of the way there:
If that worked, skip to API Setup. If not, follow your platform-specific fix below.
Requirements Before You Start
You Need:
- Node.js 18+ (check with
node --version
) - Terminal access
- Anthropic API key from console.anthropic.com
Windows Users: You MUST use WSL2. Native Windows isn't supported.
Platform-Specific Installation
Windows (WSL2 Required)
Windows needs WSL2 first. Run these in PowerShell as Administrator:
Success looks like: Version number displays without errors.
macOS (PATH Issues Common)
Standard installation often fails due to PATH conflicts:
Still broken? Homebrew users need this fix:
Linux (Permission Fixes)
Avoid sudo requirements with user-level configuration:
Ubuntu/Debian specific: If you get EACCES errors, the above commands fix it.
API Key Setup
Once installation works, configure your API key:
Where to get API key:
- Visit console.anthropic.com
- Create account or log in
- Go to API Keys section
- Create new key
- Copy the key (starts with
sk-
)
Verify Everything Works
Test your installation with this sequence:
In the Claude prompt, try: "Read hello.js and explain what it does"
Success looks like: Claude reads your file and explains the JavaScript.
Common Installation Problems
"Command Not Found"
Problem: claude
command doesn't work
Fix: PATH not configured properly
"EBADPLATFORM" Error
Problem: Trying to install on Windows without WSL2 Fix: Windows requires WSL2 - no exceptions
"EACCES" Permission Error
Problem: npm needs sudo (bad practice) Fix: Configure user-level npm directory
API Key Rejected
Problem: "Invalid API key" error Fix: Check key format and account status
- Key must start with
sk-
- Check console.anthropic.com for account status
- Create new key if needed
When Installation Completely Fails
Nuclear option - clean slate installation:
This fixes 95% of persistent installation problems.
Next Steps After Installation
Once claude --version
and claude doctor
both work:
- Start your first project: First Project Guide
- Optimize your setup: Configuration Basics
- Learn the fundamentals: What is Claude Code
Pro tip: Run claude doctor
whenever something feels wrong. It catches most configuration issues automatically.
Installation Success Checklist
Before moving on, verify:
-
claude --version
shows version number -
claude doctor
reports no errors -
claude
starts and accepts API key - Test project reads files correctly
- You understand your next steps
Last updated on