Install Claude Code on Linux: Ubuntu, Fedora, Alpine

Run curl -fsSL https://claude.ai/install.sh | bash, open a new terminal and check it with claude --version: the native installer needs no root and updates itself. Anthropic also publishes signed apt, dnf and apk repositories for Debian, Ubuntu, Fedora, RHEL and Alpine, which update with the rest of your system.

Contents

To install Claude Code on Linux, run curl -fsSL https://claude.ai/install.sh | bash, open a new terminal, and claude --version should print a version. Anthropic's native installer covers Ubuntu 20.04+, Debian 10+ and Alpine 3.19+ on x64 or ARM64, runs without root and keeps itself updated. For a package-manager install there are signed apt, dnf and apk repositories too.

Everything below comes from Anthropic's setup page and install troubleshooting page, read on 24 October 2026.

What Claude Code needs on Linux#

Requirement
Distribution Ubuntu 20.04 or later, Debian 10 or later, Alpine Linux 3.19 or later
CPU x64 or ARM64
Memory 4 GB of RAM or more
Shell Bash or Zsh
Network An internet connection, from a country Anthropic supports
Account Pro, Max, Team, Enterprise or Console. The free claude.ai plan doesn't include Claude Code

Fedora and RHEL aren't in that list, but the same page documents a dnf repository "for Fedora and RHEL". ripgrep, which Claude Code uses to search your files, is usually bundled; Alpine is the exception (below).

Which Linux install method to pick#

Method For Root? How it updates
Native installer Any supported distribution, and WSL No By itself, in the background
apt repository Debian, Ubuntu Yes sudo apt update && sudo apt upgrade claude-code
dnf repository Fedora, RHEL Yes sudo dnf upgrade claude-code
apk repository Alpine Yes apk update && apk upgrade claude-code
npm Any machine with Node.js 22+ No, and never with sudo By itself, if npm's global folder is writable

Anthropic recommends the native installer. A repository is the better fit on a machine you already patch with apt upgrade or dnf upgrade: Claude Code then moves with the rest of the system, and apt or dnf checks each package against Anthropic's key for you. Whichever you choose, use one per machine. With two copies of claude on your PATH, an update can land in one while your shell keeps starting the other.

Install Claude Code with the native installer#

  1. Paste the installer line. It is silent while it downloads, which can take a minute.
    bash
    curl -fsSL https://claude.ai/install.sh | bash
    
  2. Open a new terminal window; the old one doesn't have the new PATH yet.
  3. claude --version should answer with something like 2.1.211 (Claude Code).
  4. cd into a project and run claude. The first start opens your browser for sign-in.

What you get is ~/.local/bin/claude, a symlink into ~/.local/share/claude/versions/. The installer also takes an argument after bash -s: stable puts you on the stable channel rather than latest (curl -fsSL https://claude.ai/install.sh | bash -s stable), and a version number such as 2.1.89 installs exactly that one.

Install Claude Code on Ubuntu or Debian with apt#

Until Anthropic's repository is added, sudo apt install claude-code ends in Unable to locate package claude-code. A fresh install may also be missing curl and gpg, which sudo apt install curl gnupg adds.

  1. Fetch Anthropic's signing key into /etc/apt/keyrings:
    bash
    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
    
  2. gpg --show-keys /etc/apt/keyrings/claude-code.asc must print 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE as the fingerprint; anything else isn't Anthropic's key.
  3. Add the stable-channel repository, refresh apt and install:
    bash
    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
    

For the latest channel, both the path and the suite name change: https://downloads.claude.ai/claude-code/apt/latest latest main. If apt update later fails with NO_PUBKEY BAA929FF1A7ECACE, the key download in step 1 didn't work; run it again.

The same steps work on Ubuntu Server; the one difference there is signing in without a browser (see below). Linux Mint isn't named in Anthropic's requirements, but it is built on Ubuntu and uses apt.

Install Claude Code on Fedora or RHEL with dnf#

bash
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

The first dnf install fetches the key and shows its fingerprint for you to confirm. Say yes only to 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. The latest channel lives at baseurl=https://downloads.claude.ai/claude-code/rpm/latest.

Install Claude Code on Alpine Linux#

Alpine is built on musl, not glibc, and a stock install has neither bash nor curl, so the one-liner above stops with not found. There are two ways round it.

The apk repository, on the stable channel:

sh
wget -O /etc/apk/keys/claude-code.rsa.pub \
  https://downloads.claude.ai/keys/claude-code.rsa.pub
echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
apk add claude-code

sha256sum /etc/apk/keys/claude-code.rsa.pub should print 395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6, the hash Anthropic publishes.

The native installer also works once apk add bash curl libgcc libstdc++ ripgrep has run. ripgrep is in Alpine's community repository, so if apk can't find it, add that repository for your Alpine version to /etc/apk/repositories and run apk update. Claude Code then has to be told to use the system ripgrep, in ~/.claude/settings.json:

json
{
  "env": {
    "USE_BUILTIN_RIPGREP": "0"
  }
}

Install with npm#

With Node.js 22 or later, npm installs the same native binary the installer does:

bash
npm install -g @anthropic-ai/claude-code

Don't put sudo in front of it. Anthropic warns about permission problems and security risks if you do, and when npm can't write its global folder, the native installer is the way round that. For upgrades, npm update -g won't leave the version range of your first install, so use npm install -g @anthropic-ai/claude-code@latest.

"claude: command not found" after installing#

The Linux wording is bash: claude: command not found. The installer may have said so already with Native installation exists but ~/.local/bin is not in your PATH, and it prints the fix without applying it. In Bash, the default shell on most distributions:

bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Zsh users put the same line in ~/.zshrc. An old version that keeps starting means a second copy: which -a claude lists every claude on your PATH, and the extra ones can go. Other shells, a config file you can't write to and the Windows errors are in claude: command not found.

Check the install with claude doctor#

claude doctor starts no session and changes nothing. It reports on the install itself, any errors in your settings files and how the last update attempt went, and prints a suggested fix with each warning. It's the first thing to run when an install behaves oddly.

Installing on a small server, VPS or container#

Four errors in Anthropic's troubleshooting page come up mostly on small servers, VMs and containers.

What you see Cause and fix
Killed, or Installation was killed before it could finish (exit code 137) The out-of-memory killer. Installing needs about 512 MB free. Add swap (sudo fallocate -l 2G /swapfile, then chmod 600, mkswap and swapon on it) and rerun the installer
The install hangs in Docker Installing as root from / makes the installer scan the whole filesystem. Set WORKDIR /tmp before the RUN curl … line
Illegal instruction Either the wrong CPU architecture (compare uname -m), or a CPU or VM without AVX: grep -m1 -ow avx /proc/cpuinfo prints nothing. Anthropic has no workaround for missing AVX, and the other install methods download the same binary
Error loading shared library libstdc++.so.6 The musl build landed on a glibc system. ldd --version tells you which libc you have; remove the install and reinstall

Sign in to Claude Code on a server with no browser#

Over SSH you open the sign-in link in your own computer's browser, and its redirect can't reach Claude Code on the server. After you sign in, the browser shows a code instead; paste it at the Paste code here if prompted prompt. If pasting into the prompt does nothing, run claude auth login, which reads the code from standard input. Keeping the session alive after you disconnect is a separate problem, covered with tmux in running Claude Code over SSH.

How updates differ by install method#

The native and npm installs check for updates on start and while running, and switch to the new version on your next start. The apt, dnf and apk installs never update through Claude Code, because those commands need root: run your normal system upgrade. Their channel is set by the repository URL, not by Claude Code's /config setting. Anthropic also notes that Claude Code can tell you about an update before the package reaches these repositories; if the upgrade finds nothing, try again later. Every update command, and the fixes for failed ones, are in how to update Claude Code.

Uninstall Claude Code on Linux#

Install Remove it with
Native rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude
apt sudo apt remove claude-code, then sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
dnf sudo dnf remove claude-code, then sudo rm /etc/yum.repos.d/claude-code.repo
apk apk del claude-code, remove the repository line from /etc/apk/repositories, then rm /etc/apk/keys/claude-code.rsa.pub
npm npm uninstall -g @anthropic-ai/claude-code

Your settings, MCP servers and session history stay in ~/.claude and ~/.claude.json. Delete those only if you want them gone for good.

Is there a Claude desktop app for Linux?#

Yes, in beta. Anthropic's Claude Desktop on Linux page covers Ubuntu 22.04 or later and Debian 12 or later, on x86_64 or arm64, installed from a separate apt repository as claude-desktop. On Fedora, Arch and other distributions that aren't Debian-based, Anthropic says to run the CLI. On Windows, the Linux installer above also runs inside WSL; when that beats native Windows is in Claude Code on Windows: native or WSL.

Claude Code on Linux machines with Shuriken#

Shuriken is our harness for Claude Code, Codex and other coding agents, and Linux is one of its three desktop platforms. It comes as an AppImage and a .deb, each for x64 and Arm. There is no .rpm, so on Fedora the AppImage is the one to use. The steps, FUSE included, are in how to install Shuriken.

For a Linux server with no screen, you don't do any of the above by hand. In the app, open Settings › Devices › Add device › A server and run the command it gives you on the server; it stays valid for an hour. The installer works on x64 and arm64, glibc distributions and Alpine alike. It sets up Git, the GitHub CLI, ripgrep, Claude Code and Codex, plus other agent CLIs such as Gemini CLI and OpenCode, and checks that each one runs. Claude Code comes from Anthropic's native release: the installer picks the build for the server's CPU and libc, checks it against the checksum in Anthropic's release manifest, and runs claude install as the user the service runs as. On Alpine it also sets USE_BUILTIN_RIPGREP=0 for the service. It reports success only when Git, the GitHub CLI, Claude Code and Codex all run; otherwise it says what failed and how to fix it. After that the server runs as a systemd or OpenRC service, restarts on its own, and updates itself only to releases our key signed.

If you want a Linux box running your agents without setting each CLI up yourself, download Shuriken.

Sources

  1. Advanced setup: requirements, Linux package managers, npm, uninstall (Claude Code docs) (accessed 24 October 2026)
  2. Troubleshoot installation and login (Claude Code docs) (accessed 24 October 2026)
  3. Claude Desktop on Linux (beta) (Claude Code docs) (accessed 24 October 2026)

Frequently asked questions

Can I install Claude Code with sudo apt install claude-code?

Yes, once Anthropic's apt repository is in your sources. Before that, apt has no claude-code package and answers Unable to locate package claude-code. The order is: signing key, repository line, sudo apt update, sudo apt install claude-code.

Does Claude Code work on Linux Mint?

Linux Mint isn't on Anthropic's list of supported systems by name. It's built on Ubuntu and uses apt, so the native installer or the apt repository is the route to try, and claude doctor tells you if anything is wrong.

Does Claude Code run on Fedora or Arch?

Fedora and RHEL have a dnf repository from Anthropic, even though the requirements list stops at Ubuntu, Debian and Alpine. Arch has no repository. Anthropic's desktop app page tells Arch users to run the CLI, which means the native installer or npm.

Do I need Node.js to install Claude Code on Linux?

No. Node.js only comes into it with the npm package, which wants Node.js 22 or later, and even then the claude binary it installs doesn't run on Node. The native installer and the apt, dnf and apk packages don't need it at all.

How much memory does Claude Code need on a Linux server?

Anthropic asks for 4 GB of RAM or more to run it, and about 512 MB free just to install. On a small VPS the install can be killed with exit code 137; add a swap file and run it again.

Free tools