# Install Claude Code on Linux: Ubuntu, Fedora, Alpine

> To install Claude Code on Linux, run curl -fsSL https://claude.ai/install.sh | bash, or add Anthropic's signed apt, dnf or apk repository.

Source: https://shuriken.sh/guides/install-claude-code-on-linux

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.

By Shuriken Updated 27 October 2026 8 min read

**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](https://code.claude.com/docs/en/setup) and [install troubleshooting page](https://code.claude.com/docs/en/troubleshoot-install), 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 #

- Paste the installer line. It is silent while it downloads, which can take a minute.

bash
curl -fsSL https://claude.ai/install.sh | bash

- Open a new terminal window; the old one doesn't have the new PATH yet.
- claude --version should answer with something like 2.1.211 (Claude Code).
- 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.

- 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

- gpg --show-keys /etc/apt/keyrings/claude-code.asc must print 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE as the fingerprint; anything else isn't Anthropic's key.
- 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](https://shuriken.sh/guides/claude-command-not-found).

Shuriken adds a server of yours with one command, and its chats sit beside your computer's.

[Download](https://shuriken.sh/download)

## 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](https://shuriken.sh/guides/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](https://shuriken.sh/guides/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](https://code.claude.com/docs/en/desktop-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](https://shuriken.sh/guides/claude-code-windows-vs-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](https://shuriken.sh/guides/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](https://shuriken.sh/download).

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Finstall-claude-code-on-linux&text=Install%20Claude%20Code%20on%20Linux%3A%20Ubuntu%2C%20Fedora%2C%20Alpine)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Finstall-claude-code-on-linux)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Finstall-claude-code-on-linux&t=Install%20Claude%20Code%20on%20Linux%3A%20Ubuntu%2C%20Fedora%2C%20Alpine)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Finstall-claude-code-on-linux&title=Install%20Claude%20Code%20on%20Linux%3A%20Ubuntu%2C%20Fedora%2C%20Alpine)[E-mail](mailto:?subject=Install%20Claude%20Code%20on%20Linux%3A%20Ubuntu%2C%20Fedora%2C%20Alpine&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Finstall-claude-code-on-linux)

## Sources

- [Advanced setup: requirements, Linux package managers, npm, uninstall (Claude Code docs)](https://code.claude.com/docs/en/setup) (accessed 24 October 2026)
- [Troubleshoot installation and login (Claude Code docs)](https://code.claude.com/docs/en/troubleshoot-install) (accessed 24 October 2026)
- [Claude Desktop on Linux (beta) (Claude Code docs)](https://code.claude.com/docs/en/desktop-linux) (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.

Servers

Your agents on your own servers.

Add a Linux, macOS or Windows server from the app with one command. It runs as a service and updates itself.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [Claude Code on a VPS: sizing, setup and staying safe: Guide 27 Oct 2026 7 min read Claude Code runs on a VPS with 4 GB of RAM, an x64 or ARM64 CPU and Ubuntu 20.04+ or Debian 10+, used from a supported country. How to size and secure it.](https://shuriken.sh/guides/claude-code-on-a-vps)
- [Claude Code in a dev container: setup, firewall and auth: Guide 27 Oct 2026 5 min read Claude Code in a devcontainer is one feature line. A named volume and one env variable keep your sign-in through rebuilds; skipping prompts stays unsafe.](https://shuriken.sh/guides/claude-code-devcontainer)
- [Claude Code in GitHub Codespaces: setup and sign-in: Guide 27 Oct 2026 7 min read Claude Code runs in GitHub Codespaces through Anthropic's dev container feature, and a personal Codespaces secret keeps each new codespace signed in.](https://shuriken.sh/guides/claude-code-github-codespaces)
- [Run Claude Code on an always-on machine: Guide 27 Oct 2026 6 min read Run Claude Code on a home server, mini PC or VM that never sleeps: install, headless sign-in, tmux, remote access, or add it as a Shuriken server.](https://shuriken.sh/guides/claude-code-on-an-always-on-machine)
- [Claude Code on a Raspberry Pi: what works: Guide 27 Oct 2026 8 min read Claude Code runs on a Raspberry Pi 4 or 5 with 4 GB of RAM or more and the 64-bit Raspberry Pi OS. Which boards qualify, the 32-bit trap, and the setup.](https://shuriken.sh/guides/claude-code-raspberry-pi)
- [Claude Code teleport: pull cloud sessions to your terminal: Guide 27 Oct 2026 6 min read claude --teleport pulls a Claude Code cloud session and its branch into your terminal. It needs a clean tree, the same repo and the same claude.ai account.](https://shuriken.sh/guides/claude-code-teleport-cloud-sessions)
- [Claude Code with VS Code Remote-SSH, WSL and containers: Guide 27 Oct 2026 8 min read In a VS Code Remote-SSH, WSL or dev container window, the Claude Code extension runs remotely: sign-in, ~/.claude, MCP servers and the CLI live there.](https://shuriken.sh/guides/claude-code-vscode-remote-ssh)
- [Claude Code headless mode (-p): scripts, CI and cost caps: Guide 27 Oct 2026 5 min read Claude Code headless mode is claude -p: one prompt in, one answer out, no terminal UI. The flags that cap spend and tools, output formats, and CI.](https://shuriken.sh/guides/claude-code-headless-mode)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
