Claude Code is Anthropic’s terminal-based coding agent. Installing it takes a couple of minutes, and the native installer is the simplest path on every platform. Here is how to get it running and log in for the first time.
Check the requirements
Before you install, make sure your machine meets the basics:
- Operating system: macOS 13.0+, Windows 10 (1809+) or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+.
- Hardware: 4 GB or more of RAM, on an x64 or ARM64 processor.
- A terminal: Bash, Zsh, PowerShell or CMD all work.
- An account: a Claude Pro, Max, Team or Enterprise subscription, or a Claude Console account. The free plan does not include Claude Code.
- A network connection: Claude Code talks to Anthropic’s servers to work.
Install with the native installer (recommended)
This is the method Anthropic recommends. It installs a standalone binary and keeps itself up to date automatically, so you do not need Node.js.
On macOS, Linux or WSL, run:
curl -fsSL https://claude.ai/install.sh | bash
On Windows PowerShell, run:
irm https://claude.ai/install.ps1 | iex
On Windows CMD, run:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
On macOS and Linux the installer places the launcher at ~/.local/bin/claude. If a PS C:\ prompt rejects the CMD command, you are in PowerShell, not CMD, so use the PowerShell line instead.
Prefer a package manager? On macOS you can use Homebrew with brew install --cask claude-code, and on Windows you can use winget install Anthropic.ClaudeCode. Note that these do not auto-update, so you will need to upgrade them manually.
Install with npm (alternative)
If you would rather manage Claude Code as a global npm package, and you have Node.js 22 or later installed, run:
npm install -g @anthropic-ai/claude-code
This installs the same native binary as the standalone installer. One important warning: do not use sudo npm install -g, which leads to permission problems and security risks. If you hit permission errors, fix your npm setup rather than reaching for sudo.
Verify the installation
Confirm it worked by checking the version:
claude --version
A working install prints something like 2.1.211 (Claude Code). For a fuller health check of your install and settings, run:
claude doctor
This prints read-only diagnostics without starting a session, which is handy if anything looks off.
Start Claude Code and log in
Move into a project folder and start the interactive session:
cd /path/to/your/project
claude
On first run you will be prompted to log in. For a Claude subscription or Console account, follow the prompts to finish authentication in your browser. If you have set the ANTHROPIC_API_KEY environment variable, Claude Code skips the browser and asks you to approve that key instead. Your credentials are saved after the first login, so you will not need to repeat it. To switch accounts later, type /login inside a running session.
Once you are in, try a first prompt like “what does this project do?” to see it read your codebase. Type /help at any time for the list of commands.
Keep Claude Code updated
Native installations update themselves in the background, taking effect the next time you start Claude Code. To apply an update immediately, run:
claude update
Homebrew, WinGet and Linux package-manager installs do not auto-update. Upgrade those manually, for example brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or for npm, npm install -g @anthropic-ai/claude-code@latest.
Fix common install issues
A few problems come up often:
claude: command not found: your shell has not picked up the install directory. Close and reopen your terminal, then tryclaude --versionagain. If it still fails, runclaude doctor.- Permission errors on npm: this usually means the npm global directory is not writable, or you used sudo. Avoid
sudo npm install -gand fix your npm permissions instead. - Wrong Windows shell: if a command reports
The token '&&' is not a valid statement separator, you are in PowerShell; if it reports'irm' is not recognized, you are in CMD. Match the command to your shell. - Search failures: Claude Code bundles ripgrep, but on Alpine or other musl-based systems you may need to install
ripgrepyourself and setUSE_BUILTIN_RIPGREPto0.
Keep going
With Claude Code installed, the next step is learning to drive it well. Start with the Claude Code hub, then explore slash commands for quick actions, memory and CLAUDE.md to give it lasting project context, and connecting MCP servers to extend what it can do. If you are newer to working with AI tools, our AI course covers the fundamentals, and you can start with the free lessons too.