How to Install Claude Code: Tested Setup Guide

Tested October 9, 2026 Updated 3 min read

Setting up an agentic terminal assistant requires getting authentication, system dependencies, and execution paths right from the start. This guide walks software developers through installing Anthropic's Claude Code CLI across Linux, macOS, or Windows 11 WSL2 environments. By the end, you will have a fully functioning installation ready to inspect codebases and run terminal tasks.

Watch the video on YouTube

Before you start

  • A computer running Linux, macOS, or Windows 11 with WSL2
  • A terminal shell with curl and git installed
  • A Claude Pro or Team subscription, or an Anthropic Console account with API credits

Account Requirements and Billing

Before downloading any binaries, ensure you have an eligible Anthropic account. Claude Code does not function with standard free accounts.

You need either an active Claude Pro or Team subscription, or an Anthropic Console account supplied with prepaid API credits. Subscribers authenticate via a web browser session during initial setup, while API users configure an environment variable directly in their shell profile.

Installing Linux Prerequisites

The installer and the CLI rely on standard tools to download components and interact with your repositories. On Debian or Ubuntu systems, refresh your package repository lists and install both curl and git using the package manager.

This step was verified in our test environment to ensure minimal distributions and WSL2 instances have all necessary networking and source control utilities in place.

TerminalTested: all commands succeeded
# Install curl and git prerequisites
sudo apt-get update && sudo apt-get install -y curl git
Output from our test run
$ sudo apt-get update && sudo apt-get install -y curl git
Get:1 http://deb.debian.org/debian stable InRelease [140 kB]
Get:2 http://deb.debian.org/debian stable-updates InRelease [47.3 kB]
Get:3 https://dl.google.com/linux/chrome-stable/deb stable InRelease [2548 B]
Get:4 http://deb.debian.org/debian-security stable-security InRelease [43.4 kB]
Get:5 https://deb.nodesource.com/node_22.x nodistro InRelease [12.1 kB]
Get:6 http://deb.debian.org/debian stable/main amd64 Packages [9678 kB]
Get:7 https://dl.google.com/linux/chrome-stable/deb stable/main amd64 Packages [1405 B]
Get:8 https://deb.nodesource.com/node_22.x nodistro/main amd64 Packages [12.5 kB]
Get:9 http://deb.debian.org/debian stable-updates/main amd64 Packages [4412 B]
Get:10 http://deb.debian.org/debian-security stable-security/main amd64 Packages [265 kB]
Fetched 10.2 MB in 2s (4484 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (8.14.1-2+deb13u5).
git is already the newest version (1:2.47.3-0+deb13u1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
$

Running the Native Installer

Anthropic provides an official shell script that installs Claude Code as a standalone platform binary. Run the native installation script directly through your terminal.

This tested command detects your architecture, retrieves the latest binary, and stores it in your user directory. Using the standalone binary avoids global package manager conflicts and permission errors.

TerminalTested: all commands succeeded
# Download and run the official Claude Code native installer
curl -fsSL https://claude.ai/install.sh | bash
Output from our test run
$ curl -fsSL https://claude.ai/install.sh | bash
Setting up Claude Code...

✔ Claude Code successfully installed!

  Version: 2.1.295

  Location: ~/.local/bin/claude

  Next: Run claude --help to get started

⚠ Setup notes:
  ● Native installation exists but ~/.local/bin is not in your PATH. Run:

    echo 'export PATH="$HOME/.local/bin:$PATH"' >> your shell config file && source your shell config file

✅ Installation complete!

$

Configuring PATH and Verifying the Binary

A common obstacle after installation is an unrecognized command error when calling claude. This occurs when your current terminal session has not loaded the local user binary path.

Prepend the installation path to your active shell environment, then run the version check to confirm the binary executes properly. In our test environment, this step successfully confirmed the installed release.

TerminalTested: all commands succeeded
# Ensure the binary directory is present in PATH
export PATH="$HOME/.local/bin:$PATH"
# Confirm the installed Claude Code version
claude --version
Output from our test run
$ export PATH="$HOME/.local/bin:$PATH"
$ claude --version
2.1.295 (Claude Code)
$

Running Claude Doctor Diagnostics

Claude Code comes equipped with a built-in diagnostic utility to verify your workstation setup. Executing claude doctor reviews file permissions, platform details, search tools, and network connections.

Running this diagnostic passed in our test environment, verifying that core system dependencies and local update paths were properly configured before project use.

TerminalTested: all commands succeeded
claude doctor
Output from our test run
$ claude doctor
Claude Code doctor

Running: native (2.1.295)
Commit: 07e8f67ea328
Platform: linux-x64
Path: /root/.local/share/claude/versions/2.1.295
Config install method: native
Search: OK (bundled)
Auto-updates: enabled
Auto-update channel: latest
Last update attempt: none recorded
Managed settings (remote): not fetched — no usable credentials for the settings fetch
Organization policy: not fetched: no API key or claude.ai sign-in for the policy lookup (apiKeyHelper keys are n
ot used for it)

Remote Control
Remote Control requires a claude.ai subscription. Run claude auth login to sign in with your claude.ai account.
- Not signed in to claude.ai
- claude.ai subscription auth not active
- Sign-in is missing the user:profile scope
- Organization not resolved
- Remote Control availability could not be verified (no server response this session)

No installation issues found.

For a full setup checkup that can also fix issues, run /doctor in a Claude Code session.

Keeping Claude Code Updated

You do not need to rerun the full installation script to pick up new releases. Claude Code can check remote channels and replace its binary automatically.

Running the update command inside your terminal verifies whether a newer release exists and applies changes directly. Our test run confirmed that the tool reported a current status without issues.

TerminalTested: all commands succeeded
# Check and install any available updates
claude update
Output from our test run
$ claude update
Current version: 2.1.295
Checking for updates to latest version...
Claude Code is up to date (2.1.295)
$

macOS and Windows 11 Setup

Users on macOS can run the exact same installation script directly in their default terminal. Alternatively, maintaining the tool via a package manager is supported if you already run a supported Node environment.

On Windows 11, running Claude Code within WSL2 on Ubuntu is recommended instead of native shells, as the tool depends heavily on standard Linux execution environments. These platform-specific notes reflect Anthropic documentation.

First Launch and Authentication Flow

To start using Claude Code, navigate into any Git repository and invoke the binary. The interactive prompt will initiate an authentication workflow.

If you use a subscription, the tool prompts you to complete browser-based sign-in. If you prefer API access, export ANTHROPIC_API_KEY in your environment prior to launching your session.

~/.bashrc
export ANTHROPIC_API_KEY="sk-ant-api03-..."
export PATH="$HOME/.local/bin:$PATH"

Configuring Project Rules with CLAUDE.md

Claude Code reads repository instructions directly from a file called CLAUDE.md located at the root of your project. This file gives the agent persistent rules about your code style, test commands, and branch strategies.

Documenting standard development tasks and conventions in this file ensures the assistant generates code that aligns with your team standards.

CLAUDE.md
# Project Guidelines

## Build & Test Commands
- Build: npm run build
- Test: npm test
- Lint: npm run lint

## Coding Conventions
- TypeScript strict mode enabled
- Use early returns to reduce indentation
- Never commit directly to main branch

Wrap-up

You now have Claude Code installed, tested, and configured with proper paths and project context. With the native binary installed and verified, you can integrate Anthropic's agentic assistant directly into your daily development workflow.

FAQ

Can I use Claude Code with a free Claude account?

No, free accounts are not supported. You must have a Claude Pro, Team, or Enterprise subscription, or an Anthropic Console account with prepaid API credits.

Do I need Node.js installed to use Claude Code?

No, the official native installer installs a standalone platform binary that does not require a local Node.js runtime.

Why does my shell say claude: command not found after running the installer?

The installer places the binary into ~/.local/bin, which is not always included in your active shell path. Adding that directory to your path variable resolves the issue.

How do I update Claude Code to the newest version?

Run claude update in your terminal to check for new releases and apply background updates automatically.

Sources

Subscribe for more tested tutorials