AI

Install Claude Desktop and Claude Code on Linux

Claude Code lived in the terminal for its whole life. The 2026 desktop app changes that: a real window with Chat, Cowork, and Code tabs, parallel sessions, and side-by-side diff review, and it finally runs on Linux. The catch is that getting Claude Desktop on Linux officially covers Ubuntu and Debian only, so the rest of us on Rocky, RHEL, or Fedora still reach for the command line.

Original content from computingforgeeks.com - post 169744

This guide does both. You install the desktop app where Anthropic supports it, then install the Claude Code CLI on any distribution and sign in with your Claude account or an API key. The install steps are split by distro family so you can jump straight to apt or dnf, and the shared parts (launching the app, authenticating, and actually using it) sit in their own sections because they work the same everywhere. Every command here was run on Ubuntu 24.04 (desktop app build 1.17377.0) and Rocky Linux 10 with Claude Code 2.1.x in July 2026.

Claude Desktop vs Claude Code CLI: which one runs where

These are two separate downloads with two separate repositories, and they authenticate differently. Picking the wrong one is the thing that trips people up, so start here.

Claude Desktop appClaude Code CLI
Packageclaude-desktopclaude-code
InterfaceGraphical (Chat, Cowork, Code tabs)Terminal
Supported LinuxUbuntu 22.04+, Debian 12+ (beta)Ubuntu 20.04+, Debian 10+, Fedora, RHEL, Alpine
Sign-inClaude account only (Pro, Max, Team, Enterprise)Claude account or an API key
Best forA GUI on your Linux desktopServers, RHEL or Fedora boxes, headless and CI use

The single most important line in that table is the sign-in row. The desktop app authenticates over OAuth against your Claude account and does not read an ANTHROPIC_API_KEY, so a key sitting in your environment does nothing for it. The CLI is the one that takes an API key, which is exactly why it is the right tool on a server or anywhere you bill against the Console.

Before you start

For the desktop app you need a 64-bit Ubuntu 22.04 or later, or Debian 12 or later, on x86_64 or arm64, plus a Claude paid plan to sign in. The Code tab is gated behind Pro, Max, Team, or Enterprise. For the CLI you need 4 GB of RAM, any of the supported distros above, and either the same account or an API key from the Claude Console. Both pull from Anthropic’s signed package repositories, so a normal internet connection is the only network requirement.

Install Claude Desktop on Linux (Debian and Ubuntu)

The desktop app is Debian-based only for now, and there is no RHEL or Fedora build (the CLI covers those, further down). Install it from the apt repository rather than a one-off download, because then updates ride along with your normal system upgrades instead of going stale.

Add Anthropic’s apt repository

Download the signing key into the keyrings directory:

sudo curl -fsSLo /usr/share/keyrings/claude-desktop-archive-keyring.asc https://downloads.claude.ai/claude-desktop/key.asc

Then register the repository so apt knows where to find the package:

echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/claude-desktop-archive-keyring.asc] https://downloads.claude.ai/claude-desktop/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-desktop.list

That writes a one-line source entry pointing at Anthropic’s stable channel, which apt reads on the next update.

Verify the signing key

Before you trust the repository, confirm the key actually belongs to Anthropic:

gpg --show-keys /usr/share/keyrings/claude-desktop-archive-keyring.asc

The fingerprint should read 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE. The same key signs the CLI repository too, so you will see it again in the next part.

Install the package

Refresh the package index and install:

sudo apt update && sudo apt install claude-desktop

The package is about 144 MB to download and roughly 500 MB on disk, since it ships its own Electron runtime. Here is the install running through on a fresh Ubuntu box, with the key fingerprint check alongside it:

Installing the Claude desktop app on Ubuntu from the Anthropic apt repository and verifying the signing key

If you cannot use the repository, grab the .deb for your architecture from claude.com/download and install it with sudo apt install ./claude-desktop_*.deb. A package installed that way will not auto-update, so the repository really is the better path on a machine you keep.

Launch Claude and sign in

Launching and signing in is the same on any Debian-based system, so it gets its own section instead of hiding inside the install steps. Open Claude from your application launcher, or start it from a terminal:

claude-desktop

The first screen is the welcome view. This is the app running on an Ubuntu desktop session:

Claude for Linux desktop app welcome screen with the Get started button

Click Get started and you land on the sign-in screen. Continue with Google or with an email address tied to your Claude account. Remember the table earlier: this is an account login, not an API key, and the Code tab needs a paid plan behind that account.

Claude desktop app Sign In screen on Linux with Continue with Google and email options

Once you are in, the app has three tabs across the top. Chat is a plain conversation with no file access, like claude.ai. Cowork runs longer agentic jobs in a cloud VM. Code is the one you came for: it opens a local folder, proposes edits, and shows each change in a diff view with Accept and Reject buttons before anything touches your files. It also gives you parallel sessions in separate Git worktrees, an integrated terminal you open with Ctrl+`, and a live preview of your dev server.

One note from running it on a virtual machine: this is a full Electron GUI, so it expects a real graphical session with working GPU or software rendering. On a plain headless server there is nothing to draw to, which is the other reason the CLI exists.

What is not in the Linux beta yet

The Linux build is honest about its gaps, and they are worth knowing before you rely on it. Computer Use (letting Claude drive your screen) is not available. Voice dictation is not either, so use the CLI’s dictation if you need it. The Quick Entry global hotkey works on X11 but needs your desktop’s GlobalShortcuts portal on native Wayland. And there are no Fedora or RHEL builds of the app at all yet, which is exactly the gap the CLI fills next.

Install Claude Code (the CLI) on any distribution

The CLI is the same Claude Code engine as the desktop Code tab, and it runs on far more distributions. It is also the only path that takes an API key, so it is what you install on a Rocky or Fedora workstation, on a server over SSH, or in a pipeline. The package name is claude-code everywhere; only the package manager changes. Pick your distro family below.

Debian and Ubuntu (apt)

The CLI has its own repository, separate from the desktop one. Create the keyrings directory and pull the key:

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

Register the repository and install the package:

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

The fingerprint from the desktop section applies here too, so a quick gpg --show-keys /etc/apt/keyrings/claude-code.asc should match. The install finishes in seconds because the package is a single native binary:

Installing Claude Code CLI on Ubuntu 24.04 with apt and checking the version

For the longer Ubuntu walkthrough, including the Node and npm options, the dedicated Claude Code install guide goes deeper.

RHEL, Rocky Linux, AlmaLinux, and Fedora (dnf)

This is the part the desktop app cannot do for you. Anthropic publishes a signed dnf repository, so the CLI is a first-class citizen on the Red Hat side. Create the repo file:

sudo vim /etc/yum.repos.d/claude-code.repo

Add the repository definition:

[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

Then install. On the first install dnf downloads the key and asks you to confirm the same fingerprint before it imports it:

sudo dnf install claude-code

This is the install on Rocky Linux 10, with the key import and version check. AlmaLinux and RHEL behave identically since they share the same package format:

Installing Claude Code CLI on Rocky Linux 10 with the dnf package manager

Alpine users get an apk repository instead, and on any distro the package managers do not cover there is a one-line native installer, curl -fsSL https://claude.ai/install.sh | bash, which auto-updates itself. Package-manager installs do not auto-update, so you upgrade them with the system, covered at the end.

Sign in to Claude Code

Authentication is identical on every distro, so do it once after installing. There are two ways in, and most people want the first.

Log in with your Claude subscription (default)

If you already pay for Claude Pro, Max, Team, or Enterprise, just start Claude Code and log in with that account. Run it with no arguments inside any project directory:

claude

The first launch opens a browser to sign in, then drops you back at the prompt. Over SSH or on a headless box where no browser opens, press c to copy the login URL, open it on your laptop, and paste the code back at the Paste code here if prompted prompt. Inside a session you switch accounts any time with /login and /logout. This bills against your plan rather than per token, and it is what most readers want.

Or authenticate with an API key

On a server, in a CI pipeline, or when you want Console per-token billing, skip the browser and hand Claude Code a key from the Console instead. Export it and run a one-off prompt to confirm it works:

export ANTHROPIC_API_KEY="your-anthropic-api-key"
claude -p "In one short sentence, what does the chmod +x command do?"

The headless -p flag uses the key directly and prints the answer, which is the proof that authentication worked:

Claude Code CLI authenticated with the ANTHROPIC_API_KEY environment variable answering a prompt

A couple of behaviours are worth knowing. In an interactive session Claude Code asks once whether to use the detected key and remembers your choice. If you have both a subscription login and ANTHROPIC_API_KEY set, the API key wins after approval, so run unset ANTHROPIC_API_KEY when you want to fall back to your plan. And for long-running CI where no browser is available but you still want subscription billing, claude setup-token mints a one-year token you export as CLAUDE_CODE_OAUTH_TOKEN.

Use Claude Code

With the CLI installed and authenticated, point it at a real task. Working in any project directory is the same regardless of which distro you installed on. This run asks it to write a small program and then runs the result:

claude --permission-mode acceptEdits -p "Create primes.py with is_prime(n) and print every prime below 30"

Claude Code writes the file and reports back what it built, then the script runs on its own:

Claude Code creating primes.py and running it to print prime numbers below 30

One detail that catches people: acceptEdits auto-approves file edits but not shell commands. Asking it to chmod +x a script shows the split, where the edit applies while the chmod sits waiting for approval. That is the safety model working as intended, and it is the same diff-then-approve loop the desktop Code tab gives you with buttons. From here the CLI shares everything the GUI uses, including your CLAUDE.md files, MCP servers, subagents, and hooks, and the command cheat sheet covers the day-to-day shortcuts.

Keep Claude updated, or remove it

The desktop app does not update itself on Linux. New versions arrive with your normal system upgrades, so sudo apt update && sudo apt upgrade keeps it current, and your graphical software updater will pick it up too. The CLI repositories behave the same way: upgrade with sudo apt upgrade claude-code or sudo dnf upgrade claude-code. Each CLI repository offers a stable channel (about a week behind, skipping known-bad releases) and a latest channel that ships every release immediately. The commands above use stable; swap the suite name in the repo file if you want the bleeding edge.

Removing either one is just as clean. Drop the desktop app with sudo apt remove claude-desktop and delete its /etc/apt/sources.list.d/claude-desktop.list entry. The CLI comes off with sudo apt remove claude-code or sudo dnf remove claude-code plus the matching repo file. With the app on your Ubuntu or Debian desktop and the CLI on everything else, you now have Claude Code in front of you whether you live in a window or in a terminal.

Keep reading

Claude Code Cheat Sheet – Commands, Shortcuts, Tips AI Claude Code Cheat Sheet – Commands, Shortcuts, Tips Open Source LLM Comparison Table (2026) AI Open Source LLM Comparison Table (2026) Setup and Customize OpenCode – The Open Source AI Coding Agent AI Setup and Customize OpenCode – The Open Source AI Coding Agent RTX Pro 4000 vs RTX Pro 5000 Blackwell: Local AI Benchmarks AI RTX Pro 4000 vs RTX Pro 5000 Blackwell: Local AI Benchmarks RTX 5070 Ti vs RTX 5060 Ti 16GB: Which Blackwell GPU for Local AI in 2026? AI RTX 5070 Ti vs RTX 5060 Ti 16GB: Which Blackwell GPU for Local AI in 2026? Install Ollama on Ubuntu 26.04 LTS with Open WebUI AI Install Ollama on Ubuntu 26.04 LTS with Open WebUI

Leave a Comment

Press ESC to close