Claude Code is Anthropic’s AI coding agent for the terminal. You launch it inside a project directory, describe what you want in plain language, and it reads your code, edits files, and runs commands to get there. This guide covers installation on Debian (and Ubuntu) as well as Enterprise Linux distributions such as RHEL, Rocky Linux, AlmaLinux, and Fedora.
Requirements
Before you begin, make sure your system meets the basics:
- OS: Debian 10+, Ubuntu 20.04+, or a current EL/Fedora release
- Hardware: 4 GB+ RAM, x64 or ARM64 processor
- Network: internet connection required
- Account: a Claude Pro, Max, Team, or Enterprise plan, or an Anthropic Console account with API billing. The free Claude.ai plan does not include Claude Code.
A note on older hardware: the Claude Code binary requires modern CPU instructions (AVX/SSE4.2). If you are running on an older server — say, a pre-Nehalem or early Opteron-era machine still faithfully serving EL8 — the binary may fail with an illegal instruction error regardless of how you install it. Check with:
grep -o -m1 'avx\|sse4_2' /proc/cpuinfo | sort -u
If neither shows up, Claude Code won’t run on that box.
Option 1: Native Installer (Recommended)
Anthropic’s native installer works identically on Debian and EL. It requires no root privileges, no Node.js, and keeps itself updated automatically in the background.
curl -fsSL https://claude.ai/install.sh | bash
The installer places the claude binary at ~/.local/bin/claude and its version data under ~/.local/share/claude. If ~/.local/bin isn’t already on your PATH, add it to your shell profile:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
As with any piped installer, you can download the script first and inspect it before running it.
If you prefer the stable release channel (roughly a week behind, skipping releases with major regressions):
curl -fsSL https://claude.ai/install.sh | bash -s stable
Option 2: Distribution Package Managers
Anthropic publishes official, GPG-signed apt and dnf repositories. This is the better fit for managed systems where you want all updates flowing through the OS package manager. Note that package-manager installs do not auto-update — they upgrade through your normal apt upgrade / dnf upgrade workflow.
Debian / Ubuntu (apt)
Install prerequisites and download the signing key:
sudo apt install curl gnupg
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
Verify the key before trusting it. The fingerprint should be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE:
gpg --show-keys /etc/apt/keyrings/claude-code.asc
Register the repository (stable channel) 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
To track the latest channel instead, use this deb line (both the path and suite change):
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/latest latest main" \
| sudo tee /etc/apt/sources.list.d/claude-code.list
Upgrade later with:
sudo apt update && sudo apt upgrade claude-code
RHEL / Rocky / Alma / Fedora (dnf)
Create the repo file (stable channel) and install:
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 downloads the key on first install and prompts you to confirm the fingerprint. Verify it matches 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE before accepting.
For the latest channel, set the baseurl to:
baseurl=https://downloads.claude.ai/claude-code/rpm/latest
Upgrade later with:
sudo dnf upgrade claude-code
Verify the Installation
claude --version
A working install prints a version number such as 2.1.211 (Claude Code). For a fuller diagnostic — install health, settings validation, warnings with suggested fixes — run:
claude doctor
First Run and Authentication
Change into a project directory and start Claude Code:
cd ~/projects/my-site
claude
On first launch you’ll be prompted to log in via your browser with your Claude account. If the ANTHROPIC_API_KEY environment variable is set, Claude Code will instead ask you once to approve that key.
Updating
- Native install: updates automatically in the background. Force an immediate update with
claude update. - apt:
sudo apt update && sudo apt upgrade claude-code - dnf:
sudo dnf upgrade claude-code
Uninstalling
Native install:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
apt:
sudo apt remove claude-code
sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
dnf:
sudo dnf remove claude-code
sudo rm /etc/yum.repos.d/claude-code.repo
To wipe settings and session history as well (this deletes your allowed tools, MCP configurations, and history):
rm -rf ~/.claude ~/.claude.json
Which Method Should You Use?
For a personal workstation, the native installer is the path of least resistance — one command, automatic updates, no root required. For servers or any machine where you already manage software through apt or dnf, the signed repositories keep everything consistent with your existing update workflow.
Source: Anthropic’s official setup documentation at code.claude.com/docs/en/setup.
