Claude Code’s installation story improved dramatically in 2026. The native installer (no Node.js required) ships across macOS, Windows, and Linux, and package managers (Homebrew, WinGet, signed apt/dnf repos) finally landed. This guide walks through every supported method, common errors, and the post-install setup that makes Claude Code actually useful day one.
TL;DR (Pick Your Path)
- macOS / Linux: native installer (one curl command). Done in 2 minutes.
- Windows: WinGet or native installer. Done in 2 minutes.
- Already use Node.js:
npm install -g @anthropic-ai/claude-codeworks. - Homebrew users:
brew install claude-code(macOS / Linux).
All methods install the same binary. Pick the one that fits your existing toolchain.
Prerequisites
Before installing, confirm:
Account
- A paid Claude plan: Pro ($20/mo), Max ($100-$200/mo), Team, Enterprise, or a Console account with API access.
- The free Claude.ai plan does NOT include Claude Code.
System Requirements
| OS | Minimum Version | RAM |
|---|---|---|
| macOS | 13.0 Ventura | 4 GB (8 GB recommended) |
| Windows | 10 build 1809 (Oct 2018 Update) | 4 GB (8 GB recommended) |
| Linux | x86_64 or arm64, glibc 2.28+ | 4 GB (8 GB recommended) |
If you’re on macOS Big Sur (11) or older, upgrade your OS first.
Installation Method 1: Native Installer (Recommended)
The native installer is the official method in 2026. No Node.js required, no global npm permissions issues.
macOS
curl -fsSL https://claude.ai/install.sh | bash
Verify:
claude --version
# claude-code 2.x.x
Linux (Debian / Ubuntu / Fedora / Arch)
curl -fsSL https://claude.ai/install.sh | bash
The script detects your distro and uses the appropriate package format. For air-gapped environments, download the binary directly from https://claude.ai/cli/latest/linux-x64.
Windows
PowerShell:
iwr -useb https://claude.ai/install.ps1 | iex
Or download the installer .exe from the official docs and double-click.
After install, restart your terminal so the claude command appears on PATH.
Installation Method 2: Package Managers
Homebrew (macOS / Linux)
brew install claude-code
This taps the official anthropic-experimental/claude formula and installs the same binary as the native installer.
WinGet (Windows)
winget install Anthropic.ClaudeCode
WinGet handles the install path and PATH update automatically.
apt (Debian / Ubuntu)
# Add the Anthropic apt repo
curl -fsSL https://claude.ai/keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/anthropic.gpg
echo "deb [signed-by=/usr/share/keyrings/anthropic.gpg] https://claude.ai/apt stable main" | sudo tee /etc/apt/sources.list.d/anthropic.list
sudo apt update
sudo apt install claude-code
dnf (Fedora / RHEL)
sudo dnf config-manager --add-repo https://claude.ai/dnf/anthropic.repo
sudo dnf install claude-code
Installation Method 3: npm
If you already have Node.js (≥ 18) and prefer npm-managed tools:
npm install -g @anthropic-ai/claude-code
The npm package pulls the same native binary via a platform-specific optional dependency (@anthropic-ai/claude-code-darwin-arm64, @anthropic-ai/claude-code-linux-x64, etc.) and a postinstall step links it into place.
⚠️ Do NOT Use sudo
# DON'T DO THIS
sudo npm install -g @anthropic-ai/claude-code
Using sudo causes permission issues and is a security risk. If you get permission errors with npm install -g, fix npm’s prefix instead:
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc
First-Run Configuration
After install, run:
cd /path/to/your/project
claude
On first run, Claude Code will:
- Open a browser to authenticate your account
- Create a
~/.claude/config directory - Detect your project context
- Drop you into the interactive session
Verify Installation
claude --version
claude --help
If you see version output and help text, you’re ready.
Project Setup: AGENTS.md / CLAUDE.md
To get Claude Code working at full power, set up rule files at your project root.
Create AGENTS.md (Recommended for Multi-Tool Projects)
# AGENTS.md
## Project Context
- Stack: Next.js 15 + Postgres + Redis
- Test runner: Vitest
- Package manager: pnpm
## Commands
- Run tests: `pnpm test`
- Run dev server: `pnpm dev`
- Build: `pnpm build`
## Conventions
- TypeScript strict mode
- All API routes in `/app/api/*`
- Database migrations in `/migrations/`
## Approval Required
- Any change to `/migrations/*` files
- Any database schema modification
- Any production deploy
Or CLAUDE.md (Anthropic-Specific)
CLAUDE.md is Claude Code’s native rule file. The format is the same as AGENTS.md but it takes precedence for Claude Code specifically.
For a deeper dive, see AGENTS.md vs CLAUDE.md: When to Use Which (2026).
Common Installation Errors
Error: claude: command not found (after install)
Restart your terminal. The PATH update takes effect on new shells. If it persists:
# Check where claude was installed
which claude
# If empty, manually add to PATH
export PATH="$HOME/.claude/bin:$PATH"
Error: EACCES permission denied (npm install -g)
You used npm without configuring prefix. Either use the native installer (recommended) or fix npm prefix as shown above.
Error: macOS “cannot verify developer”
Right-click the binary → Open → confirm. Or:
sudo xattr -d com.apple.quarantine $(which claude)
Error: Windows “command not found” after WinGet install
Restart your shell or open a new PowerShell window. WinGet updates PATH but existing sessions don’t see the change.
Error: Authentication fails / browser doesn’t open
Manual auth:
claude /login
This shows a URL you can open in any browser.
Error: Linux glibc version too old
Claude Code needs glibc 2.28+. On older systems (Ubuntu 18.04, RHEL 7), upgrade the OS or use a containerized install:
docker run -it -v $(pwd):/work anthropic/claude-code:latest
Updating Claude Code
Native installer
claude /update
Or re-run the install script — it detects existing install and upgrades.
Homebrew
brew upgrade claude-code
npm
npm install -g @anthropic-ai/claude-code@latest
WinGet
winget upgrade Anthropic.ClaudeCode
Configuration Files Reference
After install, Claude Code uses these locations:
| Path | Purpose |
|---|---|
~/.claude/settings.json | Global settings |
~/.claude/projects/<project-name>/ | Per-project state |
<project>/.claude/settings.json | Project-specific settings |
<project>/CLAUDE.md or AGENTS.md | AI behavior rules |
What to Do After Install
- Set up CLAUDE.md or AGENTS.md at your project root
- Try a simple task:
claudethen ask “what does this project do? read package.json and the main entry point” - Set up Hooks if you want automation: see Claude Code Hooks Guide
- Configure your editor integration: VS Code extension or JetBrains plugin
- Read the best practices: Claude Code Best Practices 2026
Frequently Asked Questions
Do I need a paid Anthropic plan to use Claude Code?
Yes. Claude Pro ($20/mo) is the minimum. The free Claude.ai plan does not include Claude Code. Pro gives limited usage; Max plans ($100-$200/mo) give substantial daily usage limits.
Can I install Claude Code without Node.js?
Yes. Use the native installer or any package manager (Homebrew, WinGet, apt, dnf). These install the same binary as npm but without requiring Node.js.
Which install method should I pick?
If you’re on macOS or Linux: native installer or Homebrew. On Windows: WinGet. If you already manage your toolchain with npm: npm. All methods produce the same binary.
Is Claude Code open source?
The CLI itself is closed source. The terms of service allow commercial use under your paid plan. The model (Claude) is closed weights but accessible via the bundled CLI.
Can I use Claude Code on a corporate / managed device?
Yes, but check your IT policy. The CLI makes outbound HTTPS requests to api.anthropic.com. Some corporate proxies require configuration: export HTTPS_PROXY=... before running.
Can I install on a server (no GUI)?
Yes. Claude Code runs headless. Use claude /login --no-browser to get an auth URL you can complete on another device.
How do I uninstall Claude Code?
Native installer:
claude --uninstall
Or remove via your package manager:
brew uninstall claude-code # Homebrew
winget uninstall Anthropic.ClaudeCode # WinGet
npm uninstall -g @anthropic-ai/claude-code # npm
Then optionally remove ~/.claude/.
What’s the difference between Claude Code CLI and Claude Code IDE plugins?
The CLI runs in your terminal as an autonomous agent. The VS Code / JetBrains plugins provide inline assistance and integrate with your editor’s UI. Most engineers use both — CLI for deep work, plugin for inline edits.
Conclusion
Claude Code’s 2026 install experience is solid across platforms:
- ✅ Native installer in under 2 minutes
- ✅ Package managers (Homebrew, WinGet, apt, dnf) for repeatable provisioning
- ✅ npm for Node.js users
- ✅ Same binary regardless of method
- ⚠️ Avoid
sudo npm install -g(security/permissions issues)
After install, the immediate next steps are: create AGENTS.md or CLAUDE.md, run a small task to verify, and set up hooks for your workflow. The install is the easy part — the value comes from configuring your project to work well with the agent.
Related Resources
- AGENTS.md vs CLAUDE.md: When to Use Which (2026)
- Claude Code Best Practices 2026
- Claude Code Hooks Guide
- Claude Code MCP Setup Guide
- GitHub Copilot CLI vs Claude Code CLI 2026
- Claude Code VS Code Extension: Complete Guide 2026 — @-mentions, IDE MCP, checkpoint rewind, and /mcp management in the extension
Source citations: code.claude.com/docs official setup documentation, Anthropic Claude Code release notes 2026.