Quick answer (recommended in 2026): On Linux (Ubuntu, Debian, Fedora, RHEL, Alpine, Arch, or WSL) the recommended way to install Claude Code in 2026 is the official native installer. Run curl -fsSL https://claude.ai/install.sh | bash. The installer downloads a platform-specific binary, drops it at ~/.local/bin/claude, and adds itself to your shell PATH via .bashrc/.zshrc. After it finishes, cd into any project folder, run claude, and follow the sign-in prompt. The native installer auto-updates in the background and does not require Node.js, npm, or system-level root access.
Verified May 12, 2026 against the official Claude Code setup documentation.
Native installer (recommended)
The native installer is Anthropic’s official, recommended path on Linux (Ubuntu, Debian, Fedora, RHEL, Alpine, WSL). It does not depend on Node.js, npm, or any other runtime. Run:
curl -fsSL https://claude.ai/install.sh | bash
After the installer finishes, restart your shell (or open a new terminal window), then run claude from any project folder. The first run will prompt you to sign in with your Anthropic account. The binary auto-updates in the background, so you stay on the latest stable release without ever re-running an install command.
What the installer does
- Downloads a signed platform binary for
claude. - Places it at
~/.local/bin/claude(or%LOCALAPPDATA%on Windows). - Adds the install directory to your user PATH.
- Registers an auto-update channel so the binary refreshes in the background.
- Does not require root, sudo, Node.js, or npm.
Signed system repositories
For system-wide installs Anthropic publishes signed apt, dnf, and apk repositories. The native installer can configure them for you, or you can add them manually for unattended provisioning. See the official setup docs for the current repo URLs and GPG keys. A repo install lets you run apt upgrade claude-code (or dnf upgrade claude-code) like any other package.
WSL note
If you run Linux inside WSL on Windows, you can use the same install.sh command above, or install Claude Code natively on Windows from PowerShell and call it from your WSL shell via the Windows PATH.
Verify the install
After installation, open a new terminal session and check the version:
claude --version claude /doctor
claude --version should print a release tag such as claude-code 2.x.x. claude /doctor runs Anthropic’s built-in diagnostic which checks PATH, auth, network reachability, and configuration. See our walkthrough of the /doctor command for what to expect.
First run and sign-in
cd into any project directory and run claude. The first invocation opens your default browser to claude.ai and asks you to authorise the CLI against your Anthropic account. After consent, the CLI stores a refresh token locally so future runs are silent. If you use a Claude Pro, Max, Team, or Enterprise plan, your subscription is honoured automatically. If you only have API access, see Claude Code login & authentication.
Troubleshooting
“command not found: claude”
The installer added ~/.local/bin to your PATH, but you opened a shell that was already running before the install finished. Restart your terminal (or run source ~/.zshrc / source ~/.bashrc). On Windows, open a new PowerShell window so the updated user PATH is loaded.
Permission or PATH issue
If claude still cannot be found, print your PATH and verify the install directory is present:
echo $PATH ls -l ~/.local/bin/claude
If the binary exists but is not executable, run chmod +x ~/.local/bin/claude. If the directory is missing from PATH, add this line to your shell rc file: export PATH="$HOME/.local/bin:$PATH".
Check the installed version & update
The native installer auto-updates, but you can force a refresh with claude update. To see your current version run claude --version. To re-install at the latest stable release, re-run the install command from the top of this article; it is idempotent.
Uninstall
Remove the binary and config: rm ~/.local/bin/claude and rm -rf ~/.config/claude. On Windows: winget uninstall Anthropic.ClaudeCode, or delete %LOCALAPPDATA%\Programs\claude-code.
Legacy / alternate method: npm
Before the native installer existed, Claude Code shipped exclusively as an npm package. That path still works for users who already have a recent Node.js (18+) and a writable global npm prefix, but Anthropic no longer recommends it for new installs:
npm install -g @anthropic-ai/claude-code
- npm installs are not auto-updated — you have to re-run
npm install -g @anthropic-ai/claude-codemanually. - The npm version is the same CLI but starts a Node process to bootstrap, which is measurably slower on cold start.
- EACCES permission errors on global npm installs are common; you may need to configure an npm prefix or use
sudo. - If you are already on the npm version and want to switch, uninstall first:
npm uninstall -g @anthropic-ai/claude-code, then run the native installer.
FAQ
Do I need Node.js to install Claude Code?
No — the recommended native installer does not require Node.js or npm. Node is only required if you choose the legacy npm path.
Do I need a Claude Pro or Max plan?
Claude Code is available to Claude Pro, Max, Team, and Enterprise subscribers, and is also usable with API credit if you authenticate against the API. The CLI itself is free; usage costs are billed by your Anthropic plan. See Claude pricing and Claude Code pricing 2026.
How do I update Claude Code?
The native install auto-updates in the background. To force a refresh, run claude update. On the legacy npm path, run npm install -g @anthropic-ai/claude-code again. With Homebrew, brew upgrade --cask claude-code. With WinGet, winget upgrade Anthropic.ClaudeCode.
Where does the installer put files?
On Mac and Linux the binary lives at ~/.local/bin/claude and config at ~/.config/claude/. On Windows the binary lives under %LOCALAPPDATA%\Programs\claude-code and config under %APPDATA%\claude.
