Install Claude Code on Linux (Ubuntu 24.04)
The native installer, login, release channels, updates, and the apt and npm paths, checked against Anthropic's docs.

curl -fsSL https://claude.ai/install.sh | bash
That single command installs Claude Code on macOS, Linux, and WSL, and it is the path Anthropic's own docs recommend. I run it this way on Ubuntu 24.04; claude --version prints 2.1.283 (Claude Code) on my box today.
Before you install
Claude Code also runs on macOS and Windows, but for Linux, Anthropic's setup docs list:
- OS: Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+
- Hardware: 4 GB or more RAM, x64 or ARM64
- Network: an internet connection
- Shell: Bash or Zsh
- Location: an Anthropic-supported country
Ripgrep is a dependency too, but it usually ships bundled with Claude Code, so you rarely have to install it yourself.
Install with the native installer (recommended)
Run the same command from the top of this page:
curl -fsSL https://claude.ai/install.sh | bash
Native installs auto-update in the background afterward, so you are not stuck re-running this command every release. Once it finishes, open a new terminal window and check the version:
claude --version
On my Ubuntu 24.04.4 LTS box today, that prints 2.1.283 (Claude Code). The installer does not put claude in a system directory. It drops a symlink at ~/.local/bin/claude, pointing into ~/.local/share/claude/versions/, one folder per installed build. My own versions folder currently holds 2.1.281, 2.1.282, and 2.1.283.
For a deeper check than --version, run claude doctor. It prints read-only install and settings diagnostics, including the result of the most recent auto-update attempt, without starting a session.
Pick a release channel or a version
Claude Code ships two channels. latest is the default and gets new features as soon as they release. stable trails by about a week and skips releases with major regressions. Set it through /config inside a session, or in settings.json:
{
"autoUpdatesChannel": "stable"
}
You can also hand a channel or an exact version straight to the install script:
curl -fsSL https://claude.ai/install.sh | bash -s stable
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89
claude --version then prints back the exact build you asked for.
Log in
Claude Code needs a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not unlock it. Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry work too, if your organization routes through one of those instead. Logging in with a Console account auto-creates a "Claude Code" workspace there, for centralized cost tracking.
Run claude in any directory and follow the browser prompt to log in. If you already have ANTHROPIC_API_KEY set in your environment, Claude Code skips the browser and asks you to approve that key instead. To switch accounts later, type /login inside a running session.
I run mine on a Max 5x plan, since 10 Jul 2026. For what each tier actually gets you, see the Pro vs Max vs API pricing breakdown instead of guessing from the login screen.
First run in a project
cd /path/to/your/project
claude
The prompt that opens shows the version, the current model, and the working directory above it. From there you can ask it to explain the codebase, make a change, or run your tests, in plain English.
As of Claude Code 2.1.283, the version my own box runs today, auto mode is the default starting permission mode for an interactive terminal session. A classifier reviews actions instead of putting every single one in front of you, so Claude edits most files and runs most commands without asking first. It still asks before some changes, and pressing Shift+Tab at any point cycles through the other permission modes if you want tighter control.
Updates
Native installs check for updates on startup and periodically while running, then install in the background and take effect the next time you start Claude Code. You do not have to do anything for this to happen; claude doctor shows the result of the last attempt if you want to confirm.
To force an update immediately instead of waiting:
claude update
It reports Successfully updated from <old version> to version <new version>, or Claude Code is up to date (<version>) if there was nothing to do.
Other ways to install on Linux
apt, for Debian and Ubuntu. Anthropic publishes a signed apt repository:
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc -o /etc/apt/keyrings/claude-code.asc
gpg --show-keys /etc/apt/keyrings/claude-code.asc
The fingerprint gpg prints should read 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. If it matches, register the repository and install:
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update
sudo apt install claude-code
apt installs do not auto-update through Claude Code; run sudo apt update && sudo apt upgrade claude-code yourself when you want the newest build.
npm. As of Claude Code v2.1.198, the npm package requires Node.js 22 or later:
npm install -g @anthropic-ai/claude-code
Anthropic's own docs are direct about the flag people reach for out of habit: "Do NOT use sudo npm install -g as this can lead to permission issues and security risks." The npm package pulls down the same native binary the standalone installer uses, so the claude binary itself never calls into Node at runtime. To upgrade, run npm install -g @anthropic-ai/claude-code@latest rather than npm update -g, which can get stuck on the semver range from your original install.
What broke for me
A cron job I had calling claude -p produced nothing, silently. Cron runs scripts with a minimal PATH that does not include ~/.local/bin, and that is exactly where the native installer puts claude. The job was failing with "command not found," and nobody noticed, because a cron failure does not announce itself.
The fix: put this line at the top of any script cron runs, before it calls claude at all:
export PATH="$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
Then test it the way cron actually runs it, not the way your interactive shell runs it:
env -i HOME="$HOME" PATH=/usr/bin:/bin bash -c '/path/to/your-script.sh'
If the script works under that stripped-down environment, it will work under cron.
Uninstall
For a native install, remove the binary and every version it downloaded:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
If you installed through npm instead, npm uninstall -g @anthropic-ai/claude-code removes the package. Neither command touches your settings. Removing those too, with rm -rf ~/.claude and rm ~/.claude.json, deletes your allowed tools, MCP configuration, and session history along with them, so only run that if you mean it. Skip it if the VS Code extension, JetBrains plugin, or Desktop app is still installed: any of them recreates ~/.claude the next time it runs.
Related
- The Claude Code playbook
- Claude Code skills guide
- Claude Code pricing: Pro vs Max vs API
- Claude Code in India: my daily setup
- Claude Code subagents: the fork flag for parallel agents
- Orchestrating a CLI coding agent fleet in tmux
Sources
- Advanced setup, Claude Code Docs, accessed 28 Sep 2026
- Quickstart, Claude Code Docs, accessed 28 Sep 2026
Filed under
More AI Coding from the desk.

Next.js Static Export: Cloudflare Pages Preflight
A durable Next.js static-export preflight: prove the build, enumerate dynamic routes, inspect the rendered head, and audit the exact out/ artefact before a Cloudflare Pages hand-off.

Custom MCP Server in Python for Claude
Claude Code is sharp until it hits the edge of your machine and your private tools. I wrote three small MCP servers in Python to close that gap. Here is the real pattern, the real gotcha that bit me, and what it costs.

Claude Code Subagents: Fork Flag, Cache Leak
Claude Code subagents isolate their task contexts. This guide covers the current fork-cache behavior, how to measure a fanout, and the worktree pattern for parallel writers.