How To Install Claude Code on Ubuntu Linux: 2026 Guide With MCP Servers

Install Claude Code on Ubuntu with Anthropic’s signed apt repository, native stable installer, or supported npm package. This evidence-reviewed guide covers key verification, authentication, permissions, MCP scopes, validation, updates, and rollback.

Back to Blog
(Updated )
6 min read
How to Install Claude Code on Ubuntu Linux: Complete Guide 2025

Ubuntu users now have three current Claude Code installation paths: Anthropic’s signed apt repository for managed Linux fleets, the native installer for a fast user-scoped setup, and npm as a supported alternative. For most organizations, the signed stable apt channel is the cleanest operating model because installation and updates follow the same package-management controls as the rest of the workstation.

Recommended path

Use Anthropic’s signed stable apt repository on Ubuntu 20.04 or later, verify the published signing-key fingerprint, install claude-code, then run claude auth login. Use the native installer for an individual workstation when you prefer a user-scoped install. Do not use sudo npm install -g.

Prerequisites and deployment decision

Anthropic’s current system requirements list Ubuntu 20.04 or later, an x64 or ARM64 processor, at least 4 GB of RAM, an internet connection, and a supported shell. Confirm architecture and operating-system version before choosing a package.

uname -m
lsb_release -ds 2>/dev/null || cat /etc/os-release
command -v curl
command -v gpg
MethodBest fitUpdate owner
Signed apt repositoryManaged Ubuntu workstations and repeatable fleet deploymentNormal apt lifecycle
Native installerIndividual developer workstation without a Node.js dependencyClaude Code release channel and claude update
npmTeams already governing global npm toolsnpm install -g @anthropic-ai/claude-code@latest

Method 1: install from Anthropic’s signed apt repository

The official repository provides stable and latest channels. Anthropic describes stable as a slightly delayed channel that skips releases with major regressions, making it the better default for most business workstations.

sudo apt update
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

gpg --show-keys /etc/apt/keyrings/claude-code.asc

Before registering the repository, confirm the key fingerprint printed by GPG is 31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE, matching Anthropic’s current installation documentation. Stop if it differs.

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
claude --version

Upgrade through the operating-system package workflow:

sudo apt update
sudo apt upgrade claude-code

Method 2: use the native stable installer

The native installer places a user-scoped binary without requiring Node.js. Downloading and executing any remote installer is a trust decision; use the exact Anthropic hostname, review the official documentation, and apply your organization’s software-approval process.

curl -fsSL https://claude.ai/install.sh | bash -s stable
claude --version
claude doctor

The selected channel becomes the default for native auto-updates. Run claude update for an immediate update. Organizations that pin versions should use managed settings and a controlled rollout rather than relying on each developer to select a version manually.

Method 3: install through npm

Anthropic still supports npm. Current documentation says the npm package requires Node.js 22 or later, while the installed Claude Code command itself runs the downloaded native binary. If npm reports an engine warning, update Node rather than treating the warning as a supported fleet configuration.

node --version
npm --version
npm install -g @anthropic-ai/claude-code
claude --version

Do not prefix the npm installation with sudo; Anthropic warns that this can create permission and security problems. Upgrade explicitly with npm install -g @anthropic-ai/claude-code@latest, not npm update -g.

Authenticate and verify the account path

Run claude auth login or start claude and follow the browser flow. Current supported account paths include Claude Pro or Max, Claude for Teams or Enterprise, Anthropic Console, and configured enterprise providers such as Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Billing, data handling, and administration differ by path, so record the method your organization approves.

claude auth login
claude auth status --text

cd /path/to/an-approved-project
claude

SSH, container, and WSL sessions may display a login code instead of returning automatically from the browser. Follow the terminal prompt rather than copying credentials into a repository or shared shell history.

Configure permissions before connecting tools

Claude Code’s permission rules can allow, ask, or deny tool actions. Deny rules take precedence. Use /permissions to inspect the effective sources and keep destructive or externally visible actions behind explicit approval.

{
  "permissions": {
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)",
      "Read(./config/credentials.json)"
    ]
  }
}

Save team rules in .claude/settings.json only when they are safe to share. Keep personal overrides in .claude/settings.local.json and credentials in the supported authentication or secret-management path. Anthropic documents sandboxing and permission rules as complementary controls; neither makes untrusted code safe by itself.

Add MCP servers deliberately

MCP can connect Claude Code to remote services or local processes. Begin with the data or action the workflow actually needs, verify the server owner, review requested permissions, and choose the narrowest scope.

ScopeStored inUse
Local~/.claude.json for the current projectPrivate experiment or credentialed server for one project
Project.mcp.jsonShared, reviewable server configuration without committed secrets
User~/.claude.jsonPersonal utility used across projects
claude mcp list
claude mcp get server-name

# Add only a verified server URL supplied by its official owner:
claude mcp add --transport http --scope local server-name https://verified.example/mcp

The URL above is syntax only, not a real service recommendation. Replace it only with a verified endpoint from the service owner. Do not paste bearer tokens into committed .mcp.json; use supported environment expansion or an approved credential flow. Anthropic marks SSE transport as deprecated when Streamable HTTP is available.

Validate the installation

  1. Run command -v claude and confirm it resolves the intended install method.
  2. Run claude --version and claude doctor.
  3. Run claude auth status --text and verify the approved account path.
  4. Open a non-sensitive test repository and ask for a read-only explanation before allowing edits.
  5. Inspect /permissions and verify secret paths are denied.
  6. List MCP servers and remove anything that is unused, unknown, or incorrectly scoped.

Rollback and uninstall

Use the removal method matching the installation source. A machine can contain more than one Claude Code installation, so check command -v -a claude afterward and remove only the intended copy.

# apt installation
sudo apt remove claude-code

# npm installation
npm uninstall -g @anthropic-ai/claude-code

# native installation
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

Do not remove ~/.claude casually: it can contain settings and user state that may be needed for audit or recovery. Review and back up approved configuration before any cleanup.

For related guidance from ITECS, see ITECS Linux IT support.

Primary Sources

Editorial review: Installation, authentication, permission, and MCP claims were checked against Anthropic’s current official documentation on August 15, 2026. Recheck the signing fingerprint, supported Ubuntu versions, Node requirement, release channels, and commands before a managed rollout.

continue reading

More ITECS blog articles

Browse all articles

About Brian Desmot

The ITECS team consists of experienced IT professionals dedicated to delivering enterprise-grade technology solutions and insights to businesses in Dallas and beyond.

View full profile and articles

Share This Article

Continue Reading

Explore more insights and technology trends from ITECS

View All Articles