How do you install Claude Code?
Short answer: open a terminal and run the official installer. On Mac, Linux or WSL that's curl -fsSL https://claude.ai/install.sh | bash. On Windows, in PowerShell, it's irm https://claude.ai/install.ps1 | iex. Then check it with claude --version, go into your project folder and type claude to log in and start your first session.
claude --version2.1.322 (Claude Code)If you see a version number followed by (Claude Code), it's installed. Your number will probably be newer: Claude Code updates itself often.
Install Claude Code, check the version and start your first session.
What you need before installing
- An account that includes Claude Code: Claude Pro, Max, Team or Enterprise, or a Claude Console account with API credits. The free Claude.ai plan doesn't include Claude Code.
- A supported system: macOS 13 or later, Windows 10 (1809) or later, Ubuntu 20.04+, Debian 10+ or Alpine 3.19+, with 4 GB of RAM or more.
- An internet connection and a terminal: Terminal on Mac, PowerShell on Windows, or your Linux shell.
You don't need Node.js for the official installer. You only need it if you choose to install with npm.
Install Claude Code: every option
# Mac, Linux and WSL: official installer (recommended)
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell: official installer (recommended)
irm https://claude.ai/install.ps1 | iex
# Windows CMD: official installer
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
# Mac with Homebrew
brew install --cask claude-code
# Windows with WinGet
winget install Anthropic.ClaudeCode
# Any system with Node.js, with npm
npm install -g @anthropic-ai/claude-codeThe official installer is the best option for most people: it doesn't need Node.js and it keeps Claude Code updated in the background.
Install Claude Code on Mac or Linux
Open the terminal and run:
curl -fsSL https://claude.ai/install.sh | bashThe script downloads Claude Code, checks it and sets it up. At the end it prints ✅ Installation complete!. Open a new terminal and check it:
claude --versionDon't run the installer with sudo. Claude Code installs into your home folder and doesn't need root access; with sudo it would install for the root user and the claude command wouldn't work from your own terminal.
On Mac you can also use Homebrew: brew install --cask claude-code. In that case Homebrew handles the updates with brew upgrade claude-code.
Install Claude Code on Windows
Open PowerShell (not as administrator) and run:
irm https://claude.ai/install.ps1 | iexIf you prefer WinGet:
winget install Anthropic.ClaudeCodeClose and reopen the terminal, then run claude --version. Installing Git for Windows is recommended: Claude Code uses its Bash to run commands. Without it, Claude Code uses PowerShell instead. If you work inside WSL, install it with the Linux command from the WSL terminal.
Install Claude Code with npm
If you already work with Node.js, you can install it as a global npm package:
npm install -g @anthropic-ai/claude-codeThe current package declares Node.js 22 or later, so check your version first with node -v. Never use sudo npm install -g: if you get permission errors, install Node.js with nvm. If you don't have Node.js yet, see how to install JavaScript (Node.js).
