ai coding · guide
Installing Claude Code in 2026: the current way, not the 2024 way.
verdict
Use the native installer — Anthropic now recommends it over the npm and Homebrew routes, which are legacy paths that most older tutorials still teach. No Node.js required, works on macOS, Linux, and Windows. Two minutes if nothing goes wrong; the fixes below if something does.
This guide is field-tested, not paraphrased from docs: the site you're reading was deployed to a VPS by Claude Code, driven from a Windows laptop. Everything below is what actually happened, including the errors.
Quick start
macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bash |
Windows (PowerShell):
irm https://claude.ai/install.ps1 | iex |
Then verify:
claude --version |
A version number back means you're done installing. If anything looks off later, claude doctor auto-diagnoses most config problems. Commands drift — the official setup page is canonical if these ever fail.
System requirements (the short version)
| OS | macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+ |
|---|---|
| Hardware | 4 GB+ RAM, x64 or ARM64 |
| Shell | Bash, Zsh, PowerShell, or CMD |
| Node.js | Only for the legacy npm route — the native installer ships its own runtime |
One caveat from real use: 4 GB is the floor for Claude Code itself, not for what it does — if it's running your test suite or booting Docker containers, budget RAM for those too.
The cost decision (read before you authenticate)
First launch asks you to sign in. You have two roads, and the choice is the difference between a fixed bill and a surprising one:
Subscription (Pro/Max): fixed monthly cost, usage caps that reset every few hours. You cannot accidentally spend more than the subscription price. This is the sane default for a solo dev.
API key (pay-per-use): scales with usage — and agentic work is token-hungry. A long refactor or a chatty debugging session can burn through credit fast. Fine for occasional use or CI; set a spend limit in the console before your first big session, not after.
Troubleshooting: the errors that actually happen
claude: command not found right after install — the installer added Claude to your PATH but your current shell hasn't reloaded it. Open a new terminal window. If it persists, re-run the installer and watch for a "add this to your profile" line it printed at the end.
Permission denied during install (Linux) — you're probably installing system-wide without root. The native installer targets your user directory, so run it as your normal user, not with sudo.
Old npm version fighting the native one — if you installed via npm in 2024–25, uninstall it first (npm uninstall -g @anthropic-ai/claude-code) or claude --version may resolve to the stale binary.
Auth loop or expired token — claude doctor flags this; sign out and re-authenticate, or re-export a fresh API key.
Claude Code vs Cursor, in one paragraph
They're different shapes: Cursor is an editor with AI inside it; Claude Code is an agent you hand tasks to from the terminal (or its desktop app), and it goes and does them — multi-file edits, running commands, deploying. If you live in your IDE, try Cursor. If you delegate whole tasks — "deploy this site to my server" — Claude Code is the one that can actually execute it, which is exactly how this site got deployed.
Running your projects on a cheap server? Claude Code pairs absurdly well with a VPS — see how I run everything from a $5 VPS and the best VPS under $10.
Some links on this page are affiliate links — if you sign up through them, SoloStack earns a commission at no extra cost to you. I only list tools I'd run on my own server. Full disclosure.