Claude Code on WSL - Installation Guide¶
Requirements¶
- Windows 10+ with WSL 1 or WSL 2
- 4GB RAM minimum (for basic perfomance, use 16GB for optimal use)
- Node.js 18+
- Internet connection
Step 1: Install Node.js in WSL¶
Check if you already have Node.js:
If Node.js is missing or points to Windows, install it:
Ubuntu/Debian:
Verify:
Step 2: Configure npm for Linux¶
Step 3: Install Claude Code¶
Important: Do NOT use sudo
If installation fails:
Step 4: Verify Installation¶
Step 5: Launch Claude Code¶
Follow the authentication prompts to log in.
Troubleshooting¶
Issue: PATH Conflicts (Windows Node.js detected)¶
Symptom: which node shows /mnt/c/Program Files/...
Fix: Prepend Linux paths in ~/.bashrc:
Issue: Permission Errors¶
Never use sudo with npm global installs.
Fix: Configure npm user directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Reinstall:
Issue: JetBrains IDE Not Detected (WSL2 only)¶
Symptom: IDE on Windows not detected by Claude Code in WSL2
Quick fix: Use native Windows install instead:
Advanced fix: Configure mirrored networking in C:\Users\YourUsername\.wslconfig:
Restart WSL from PowerShell:
Updates¶
Quick Reference¶
Alternative: Native Windows installer (bypasses all WSL/npm issues):