How to install Claude Code on Linux: Ubuntu, Fedora, Arch, WSL, and a desktop app
Install Claude Code on Linux with the native installer, apt, dnf, the AUR or npm; fix PATH and WSL errors, update, uninstall, and run it in a desktop app.
To install Claude Code on Linux, run curl -fsSL https://claude.ai/install.sh | bash as your normal user, open a new terminal and run claude. It puts one binary under your home folder, needs no sudo and updates itself. On Debian, Ubuntu, Fedora and RHEL you can use Anthropic's signed apt or dnf repository instead, and on Arch the AUR. The commands here were checked against Anthropic's docs on 15 October 2026, and the main ones run in fresh containers that day.
Install Claude Code on Ubuntu or Debian
The native installer is what Anthropic recommends, on Ubuntu 20.04 or later and Debian 10 or later:
- 1
Install, as your normal user
- 2
Open a new terminal, then check
- 3
Start it in a project
The binary goes to ~/.local/share/claude/versions/ and a launcher to ~/.local/bin/claude. It prints no progress while it downloads. Run it without sudo: a root install lands in root's home, not yours.
To have apt install and update it instead, add Anthropic's repository. This is the stable channel, typically about a week behind and without releases that had major regressions. A minimal system first needs sudo apt install curl gnupg. Download the key, then check it:
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 be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE. Then add the repository and install. This is Anthropic's deb line with the key and the address in two variables, so it fits on a screen:
KEY=/etc/apt/keyrings/claude-code.asc REPO=https://downloads.claude.ai/claude-code/apt/stable echo "deb [signed-by=$KEY] $REPO stable main" \ | sudo tee /etc/apt/sources.list.d/claude-code.list sudo apt update sudo apt install claude-code
For the latest channel, both change: REPO ends in /apt/latest, and stable main becomes latest main. The package puts claude in /usr/bin, which is already on your PATH.
Install Claude Code on Fedora or RHEL
Fedora is not in Anthropic's list of system requirements, but Anthropic's dnf repository is "for Fedora and RHEL", and its native installer above is the same for every Linux. With dnf, on the stable channel, paste this whole block:
sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF' [claude-code] name=Claude Code baseurl=https://downloads.claude.ai/claude-code/rpm/stable enabled=1 gpgcheck=1 gpgkey=https://downloads.claude.ai/keys/claude-code.asc EOF sudo dnf install claude-code
dnf asks you to accept the key on the first install. Accept it only if the fingerprint reads 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. On Fedora 44 it did, and installed 2.1.292 into /usr/bin/claude. For the latest channel, set baseurl to .../claude-code/rpm/latest.
Install Claude Code on Arch Linux
Arch is not in Anthropic's list of system requirements, and Anthropic publishes no pacman package. Its one install command is the same for every Linux, and the AUR has a community package:
- 1
Anthropic's installer
- 2
Or the AUR, with an AUR helper
The AUR's claude-code (2.1.300 on 15 October, kept by community maintainers) downloads Anthropic's binary from downloads.claude.ai, checks it against a SHA-256 in the PKGBUILD and installs it to /opt/claude-code. Its /usr/bin/claude wrapper sets DISABLE_UPDATES=1, so Claude Code never updates itself: paru -Syu or yay -Syu does. yay -S claude-code works the same as paru.
Alpine and other musl systems
Alpine is supported from 3.19. Its base image lacks bash and curl, so the installer fails with not found until you add them, plus the libraries Claude Code needs at run time:
- 1
The packages; ripgrep is in the community repository
- 2
Then install
Then set USE_BUILTIN_RIPGREP to "0" in the env block of ~/.claude/settings.json. Anthropic also runs an apk repository, with its own key, on its setup page.
The native installer or npm
npm install -g @anthropic-ai/claude-code installs the same native binary through a per-platform package (linux-x64, linux-arm64 and the two -musl builds). It needs Node.js 22 or later, and npm's optional dependencies and install scripts must be allowed, or claude stays a placeholder that prints Error: claude native binary not installed.
Never run it as sudo npm install -g. Anthropic's docs warn against it, and an npm folder that only root can write is also one Claude Code cannot update. If npm reports EACCES, switch to the native installer rather than reaching for sudo.
Sign in, on a desktop or over SSH
Run claude and follow the browser prompt. You need a Pro, Max, Team or Enterprise plan or a Console account; the free claude.ai plan does not include Claude Code. What each plan gives is in Claude Code pricing.
On a server over SSH, in a container or in WSL 2, the browser opens on another machine and cannot call back. After you sign in, the page shows a code: paste it at Paste code here if prompted. If pasting does nothing, run claude auth login, which reads the code from standard input. With ANTHROPIC_API_KEY set, Claude Code asks whether to use the key, and if you approve it skips the login.
Fix "claude: command not found"
The installer puts claude in ~/.local/bin and does not edit your shell files. When that folder is not on your PATH, it prints Native installation exists but ~/.local/bin is not in your PATH and bash then answers bash: claude: command not found. Whether a new terminal fixes it depends on the distribution's stock files for a new user, as they were on 15 October:
- Ubuntu 24.04 and Debian 12.
~/.profileadds~/.local/binonly if the folder existed when you logged in. On a fresh account it did not, so log out and back in, or add the line below. - Fedora 44.
~/.bashrcalways adds~/.local/bin. A new terminal findsclaude. - Arch. Nothing adds it. Add the line below.
- 1
Add the folder to bash's PATH
- 2
Apply it to this terminal
- 3
Check
For zsh use ~/.zshrc; for fish, fish_add_path ~/.local/bin. A terminal inside an editor takes its PATH from the editor, so restart the editor too. Two installs at once show up in which -a claude; keep one.
Claude Code in WSL
Open your WSL distribution and run the Linux installer there, not in PowerShell: in WSL, Claude Code is the Linux program, and everything on this page applies.
- WSL 2 supports Claude Code's sandboxed command execution; WSL 1 does not.
- WSL 1 fails with
cannot execute binary file: Exec format error. Convert the distribution from PowerShell withwsl --set-version <DistroName> 2. - npm inside WSL can pick up Windows' Node.js.
which npmandwhich nodeunder/mnt/c/mean it did; the native installer avoids the question.
Running Claude Code on Windows itself, without WSL, is in how to install Claude Code.
Common install errors on Linux
Killedduring the install. The out-of-memory killer stopped it; the installer reports exit code 137 and says it needs roughly 512 MB free. Add swap (sudo fallocate -l 2G /swapfile, thenchmod 600,mkswapandswaponon it) or use a larger machine. Running it needs 4 GB.Illegal instruction, orCPU lacks AVX support. The CPU or the virtual machine has no AVX: pre-2013 processors, or a hypervisor that does not pass it through.grep -m1 -ow avx /proc/cpuinfoprints nothing on such a machine. In an x64 emulator without AVX on 15 October the installer printedCPU lacks AVX supportand stopped with exit code 139. There is no workaround: npm and the repositories install the same binary.Error loading shared library libstdc++.so.6. A glibc system with musl cross-compilers installed can get the musl build.ldd --versionsays which libc you have; on glibc, remove Claude Code and install again.syntax error near unexpected token '<'or a 403. The install URL returned a web page or an error instead of the script. "App unavailable in region" in the output means Claude Code is not offered in your country; otherwise a proxy, a firewall or a short outage. Retry in a few minutes.- The install hangs in Docker. Run as root from
/, the installer scans the whole file system. SetWORKDIR /tmpfirst. NO_PUBKEY BAA929FF1A7ECACEfrom apt. The key download failed; repeat it and check the fingerprint.Bus errormid-session. The binary became unreadable while it ran, typically a home folder on NFS. Install to local disk or with a package.
What the install took
- 16 s
- Anthropic's installer, Ubuntu 24.04
- 266 MB
- the binary it leaves, 2.1.300
- 2.1.292
- what apt and dnf served on stable
Fresh containers on an Apple silicon Mac, arm64 Linux, 15 October 2026: the installer took 15 and 16 seconds in two runs and installed 2.1.300, the latest channel. Anthropic's apt and dnf repositories on stable served 2.1.292, built 6 October: a 113 MB download, 251 MB installed (bytes / 10^6). Your network decides the time.
Update Claude Code on Linux
The native install checks for updates when it starts and while it runs, and switches to a new version the next time you start it. claude update installs one now; claude doctor shows the last attempt. The channel is autoUpdatesChannel in /config; the repositories choose it by URL instead.
| Installed with | Update |
|---|---|
| Native installer | automatic, or claude update |
| apt | sudo apt update && sudo apt upgrade claude-code |
| dnf | sudo dnf upgrade claude-code |
| AUR | paru -Syu or yay -Syu |
| npm | npm install -g @anthropic-ai/claude-code@latest |
Uninstall Claude Code on Linux
| Installed with | Remove |
|---|---|
| Native installer | rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude |
| apt | sudo apt remove claude-code, then delete the .list file and the key |
| dnf | sudo dnf remove claude-code, then delete the .repo file |
| AUR | sudo pacman -Rns claude-code |
| npm | npm uninstall -g @anthropic-ai/claude-code |
Your settings, MCP servers and session history stay in ~/.claude and ~/.claude.json. Delete them only if you want them gone; it cannot be undone.
A desktop app for Claude Code on Linux
Anthropic's Claude Desktop has a Linux beta with Chat, Cowork and the Code tab. It is a .deb from Anthropic's apt repository (sudo apt install claude-desktop) for Ubuntu 22.04 or later and Debian 12 or later, x86_64 or arm64. Anthropic's docs say to run the CLI instead on Fedora or Arch. It signs in with a claude.ai plan or SSO, not a Console API key, and updates with apt.
Caprock is a free, open-source desktop app that records every Claude Code session on the machine, whether or not it started it, and runs the claude you just installed in terminal tabs, beside Codex, OpenCode, Gemini CLI, Grok Build and Hermes Agent. It needs WebKitGTK 4.1 (Ubuntu 22.04, Debian 12, Fedora 38 or newer) and an x64 machine:
- 1
Any distribution, no sudo
- 2
Or the .deb, Debian and Ubuntu
- 3
Or the .rpm, Fedora and RHEL
The script downloads Caprock-Linux.AppImage into ~/.local/share/caprock, adds Caprock to your applications menu and opens it. Where FUSE 2 is missing, as on Ubuntu 22.04 and newer, its launcher runs the AppImage without it. Run it again to update. The packages are Caprock-Linux.deb and Caprock-Linux.rpm; they pull in WebKitGTK themselves.
- It finds your
claudewherever this page put it:~/.local/bin,/usr/bin, npm's folder or nvm's. An app started from the menu inherits your login session's PATH, which on a fresh Ubuntu account lacks~/.local/bin; Caprock also reads your login shell's PATH and checks those folders itself. - Every session, not only its own. Claude Code started in any terminal is recorded from its hooks and transcript, with cost per session and per project at API list prices. On a plan that is an equivalent, not a bill.
- No desktop at all. On a server the daemon alone serves the same dashboard on
127.0.0.1:22776. Homebrew on Linux has it asbrew install dspv/tap/caprock; the releases havelinux_amd64andlinux_arm64archives.caprock service installadds a systemd user unit that starts it when you log in.
This is caprock status from v0.119.0 in a fresh Debian 12 container on 15 October, with Claude Code installed from Anthropic's apt repository:
$ caprock up --yes $ caprock status daemon: running http://127.0.0.1:22776 (pid 3500, up 4s, 0.119.0) data: /home/dev/.config/caprock pricing: 2026-10-13.1 (44 models) hooks: 10/10 events registered in /home/dev/.claude/settings.json ingest: 0 transcripts, 0 events stored, 0 deduped, backfill done claude: found on PATH — Caprock can start sessions for you
claude: is the line to check: found means Caprock can start Claude Code for you. hooks: is one of the two edits Caprock makes to Claude Code's settings.json, the other being a status line. Plain caprock up asks before each; --yes answered for this run. ingest: reads 0 because the container had no sessions yet; on your machine it imports the transcripts still in ~/.claude/projects.
Caprock reads the ~/.claude of the system it runs on, so sessions inside WSL need Caprock inside WSL. The Linux script stops in WSL and points to the Windows installer; CAPROCK_WSL=1 before sh installs the Linux app there instead.
Which to pick
- The native installer — any distribution, and you want updates without thinking about them.
- apt or dnf — you want
claudeupdated with the rest of the system, or installed for every user in/usr/bin. - The AUR — you are on Arch and want pacman to own every binary.
- npm — you already pin tools per machine with Node.js 22 or later.
- Claude Desktop — Ubuntu or Debian, and you want Anthropic's own window with Cowork.
- Claude Code beside your other agents, in one record — install Claude Code above, then install Caprock.
Questions people ask
- How do I install Claude Code on Linux?
- Run curl -fsSL https://claude.ai/install.sh | bash, open a new terminal and run claude. Debian, Ubuntu, Fedora and RHEL can use Anthropic's signed apt and dnf repositories instead, Arch has a community package in the AUR, and npm install -g @anthropic-ai/claude-code works with Node.js 22 or later.
- Does Claude Code work on Ubuntu?
- Yes. Anthropic lists Ubuntu 20.04 or later, on x64 or ARM64 with 4 GB of RAM. Install it with the script, or from Anthropic's apt repository so it updates with apt upgrade.
- How do I install Claude Code on Arch Linux?
- Anthropic's one install command, curl -fsSL https://claude.ai/install.sh | bash, is the same for every Linux, though Arch is not in its list of system requirements. There is no Anthropic package for pacman; the AUR's claude-code package, kept by community maintainers, installs Anthropic's binary and is updated through your AUR helper.
- Why does it say claude: command not found after installing?
- The installer puts claude in ~/.local/bin, and that folder is not on your PATH yet. Add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc and open a new terminal. On Ubuntu and Debian, logging out and back in also works.
- Is there a Claude Code desktop app for Linux?
- Anthropic's Claude Desktop has a Linux beta for Ubuntu 22.04+ and Debian 12+, installed from its apt repository; Anthropic says to run the CLI on Fedora or Arch. Caprock, a free desktop app, runs the claude you installed in terminal tabs, as an AppImage, .deb or .rpm for x64.
- Do I need Node.js to install Claude Code on Linux?
- No. The native installer and the apt, dnf and apk repositories need no Node.js. Only the npm package does, and even then the installed claude binary does not run on Node.
Sources
- Claude Code docs — Advanced setup: system requirements, native install, apt, dnf and apk repositories, npm, Alpine, updates, uninstall, read 15 October 2026, re-read 20 October 2026
- Claude Code docs — Troubleshoot installation and login: PATH, conflicting installs, Killed, musl or glibc, Illegal instruction, WSL1, npm in WSL, login over SSH, read 15 October 2026, re-read 20 October 2026
- Claude Code docs — Claude Desktop on Linux (beta): requirements, apt install, update, uninstall, read 15 October 2026, re-read 20 October 2026
- Claude Code docs — Quickstart, read 15 October 2026
- AUR — claude-code 2.1.300-1, its PKGBUILD (Anthropic's binary from downloads.claude.ai, a /usr/bin/claude wrapper that sets DISABLE_UPDATES=1), read 15 October 2026
- Installs run for this page on 15 October 2026 in Docker on an Apple silicon Mac (arm64 Linux): the native installer on Ubuntu 24.04 twice, apt on Debian 12, dnf on Fedora 44, and the x64 installer on Arch under emulation without AVX
- Google US results for install claude code linux, claude code linux and claude code ubuntu, DataForSEO, read 15 October 2026 (.gtm/data/2026-10-15-serps-claude-code-linux.tsv)
- Caprock — installing the desktop app: Linux AppImage, .deb and .rpm, WebKitGTK 4.1, x64 (docs/install-app.md)
- Caprock — the Linux install script: the AppImage into ~/.local/share/caprock, a menu entry, no sudo, works without FUSE 2, WSL handling (caprock.dev/linux.sh)
- Caprock source — where Caprock looks for claude: the login shell's PATH, ~/.local/bin, npm, nvm (internal/agents/binaries.go)
- Caprock source — transcripts are read from ~/.claude/projects of the system the daemon runs on (internal/daemon/daemon.go)
- Caprock v0.119.0 release — Caprock-Linux.AppImage, .deb, .rpm and the linux_amd64 and linux_arm64 daemon archives, 15 October 2026
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app