How to Install Claude Code
Step-by-step guide to installing Claude Code on macOS, Linux, or Windows WSL. Covers Node.js setup, npm install, and authentication.
Step-by-step
How to Install Claude Code
Install Node.js 18+
Claude Code requires Node.js 18 or later. Download from nodejs.org or use nvm: `nvm install 18 && nvm use 18`. Verify with `node --version`.
Install Claude Code via npm
Run `npm install -g @anthropic-ai/claude-code` in your terminal. This installs Claude Code globally so you can use it from any directory.
Authenticate with your Anthropic account
Run `claude` in your terminal. On first launch, it opens a browser window for OAuth authentication. Sign in with your Anthropic account (Max or API plan).
Verify the installation
Navigate to any project directory and run `claude`. You should see the Claude Code interface ready for commands.
Tips
Pro tips
- *
Use nvm (Node Version Manager) to manage multiple Node.js versions without conflicts
- *
If you're behind a firewall, you may need to set npm proxy: `npm config set proxy http://proxy:port`
- *
Claude Code also works in Windows via WSL (Windows Subsystem for Linux)
Related guides