Claude Code on Linux: Ubuntu, Debian & Alpine Installation Guide
Install Claude Code on Ubuntu, Debian, Alpine Linux, and other distributions. Includes native install, troubleshooting, and Linux-specific configuration.
Linux Requirements
Claude Code supports the following Linux distributions:
- Ubuntu 20.04+ (LTS recommended)
- Debian 10+
- Alpine Linux 3.19+ (additional dependencies required)
- Most other modern Linux distributions with glibc
Hardware:
- 4 GB+ RAM (8 GB+ recommended for large codebases)
- Active internet connection
- Bash or Zsh shell
Installation: Native Installer (Recommended)
The universal method that works on all supported distributions:
curl -fsSL https://claude.ai/install.sh | bash
This installs the Claude Code binary to ~/.local/bin/claude with automatic background updates.
Verify Installation
claude --version
claude doctor
Ubuntu / Debian Specific
Ubuntu and Debian work out of the box with the native installer. No additional packages needed.
PATH Setup
If claude is not found after installation, add to your shell profile:
# For Bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# For Zsh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Alpine Linux (musl-based)
Alpine and other musl/uClibc-based distributions require additional packages:
apk add libgcc libstdc++ ripgrep
Also set the ripgrep environment variable:
export USE_BUILTIN_RIPGREP=0
Then install Claude Code:
curl -fsSL https://claude.ai/install.sh | bash
Stable vs Latest Channel
By default, the installer uses the latest channel. For production environments or if you prefer stability:
# Install stable channel
curl -fsSL https://claude.ai/install.sh | bash -s stable
The stable channel runs versions that are about one week old, skipping any releases with major regressions.
Authentication
Launch Claude Code:
claude
Authenticate using one of:
- Claude Pro/Max Plan — Subscribe at claude.ai/pricing
- Anthropic Console — Set up billing at console.anthropic.com
- Cloud Providers — Amazon Bedrock, Google Vertex AI, or Microsoft Foundry
Linux Configuration Tips
Terminal Emulators
Claude Code works well in all major Linux terminal emulators:
- GNOME Terminal — Default on Ubuntu
- Konsole — Default on KDE
- Alacritty — GPU-accelerated, fast
- Kitty — Feature-rich with image support
- tmux/screen — Multiplexer support works great
Font Recommendation
Install JetBrains Mono for optimal code rendering:
# Ubuntu/Debian
sudo apt install fonts-jetbrains-mono
# Or download manually from
# https://www.jetbrains.com/mono/
Running in tmux
Claude Code works seamlessly inside tmux sessions:
tmux new -s coding
cd ~/projects/my-app
claude
This lets you detach and reattach to long-running Claude Code sessions.
Server / Headless Setup
Claude Code works on headless servers too. SSH into your server and run:
ssh myserver
cd /var/www/my-app
claude
Authentication will provide a URL to open in your local browser.
Docker Usage
You can run Claude Code inside Docker for isolated environments:
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y curl
RUN curl -fsSL https://claude.ai/install.sh | bash
ENV PATH="/root/.local/bin:$PATH"
Troubleshooting
libstdc++ errors
On minimal distributions:
# Ubuntu/Debian
sudo apt install libstdc++6
# Alpine
apk add libstdc++
Search not working
Install ripgrep if search features fail:
# Ubuntu/Debian
sudo apt install ripgrep
# Alpine
apk add ripgrep
Permissions
Never use sudo to install Claude Code. The native installer installs to user space (~/.local/bin/).
Updating & Uninstalling
Update
claude update
Uninstall
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Remove settings (optional)
rm -rf ~/.claude ~/.claude.json
Next Steps
- Complete Installation Guide — All methods and platforms
- What is Claude Code? — Full feature overview
- Terminal Commands Cheat Sheet — Quick reference
- Visit Claude.ai to get started