Claude on WholeTech network
home/newby-linux
Linux & Unix · Beginner to Builder

Hello, Claude.

A clear, step-by-step tutorial for installing Claude Code on Linux and Unix systems. Works on Ubuntu, Debian, Fedora, Arch, openSUSE, Alpine, WSL2, and the BSDs. About five minutes if Node is already there.

If you've used a terminal before, this page is everything you need.

Time: ~5–10 min Steps: 5 Prereqs: Node 18+, npm Cost: Free tier available

What you're about to install

Claude Code is Anthropic's terminal app. Once it's running, you can type plain English and Claude will read, write, and run code on your machine — refactor a project, organize files, query a database, ship a deploy. It's the same Claude as the web app, but with hands.

Three things make this short: most Linux users already have a terminal they like, package managers handle the dependencies, and the install itself is a single npm command.

The fastest install — one line

Anthropic's recommended install. No Node required. Self-updates. Works on macOS, Linux, and WSL.

curl -fsSL https://claude.ai/install.sh | bash

Then run claude, sign in via the browser link it prints, and you're in. That's the whole install.

Alternatives, in order of preference:

If claude --version works after the install, you're done. The five-step Node/npm walk-through below is the original install path and still works — useful if you can't run the native installer for some reason.

Alternative — the five-step npm path

  1. Install Node.js (version 18 or newer) ~2 min

    Claude Code needs Node 18+. Pick the row for your distro. If you already have node --version showing 18+, skip to step 2.

    Ubuntu / Debian / WSL apt

    curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
    sudo apt-get install -y nodejs

    Fedora / RHEL / CentOS dnf

    sudo dnf install -y nodejs npm

    Arch / Manjaro pacman

    sudo pacman -S nodejs npm

    openSUSE zypper

    sudo zypper install nodejs22 npm22

    Alpine apk

    sudo apk add nodejs npm

    FreeBSD pkg

    sudo pkg install node npm
    Recommended for most users — nvm. If you'd rather manage Node versions per-project, install nvm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
    # restart shell, then:
    nvm install 22
    nvm use 22

    Verify: node --version should print v18.x or higher (we recommend v22).

  2. Install Claude Code ~30 sec

    One command, global install via npm:

    sudo npm install -g @anthropic-ai/claude-code

    If you used nvm, drop the sudo:

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

    Verify: claude --version should print a version number.

    Permission errors with npm and sudo? The cleanest fix is nvm (see step 1). It installs Node into your home directory, so global npm packages don't need root.
  3. Sign in ~1 min

    Run:

    claude

    The first time, it opens your browser for sign-in. Use the same Anthropic account you'd use at claude.ai. Approve, return to your terminal — you'll see the Claude prompt.

    If you're on a headless server (no browser), Claude prints a URL you can open from another machine. Sign in there; the terminal session picks up the credentials automatically.

  4. Run your first prompt ~30 sec

    Try a small, safe one to confirm everything works:

    > tell me what files are in this directory and what each one is for

    Claude reads, summarizes, and waits for the next thing. Try a real one:

    > create a simple Python script that prints today's weather for Austin, TX

    Claude proposes the file, asks before writing it, runs it, shows the output.

  5. Learn the slash commands ~1 min

    Type /help to see them all. The handful worth knowing on day one:

    /helpLists every built-in command
    /initGenerates a CLAUDE.md describing the current codebase
    /reviewReviews the current branch's pending changes
    /clearClears history, resets the context window
    /costShows what this session has spent
    /scheduleSchedules a recurring agent on a cron
    /exitQuit

If something goes wrong

npm: command not found

Node didn't install correctly, or your shell hasn't reloaded. Close and reopen the terminal, then re-run node --version. If still missing, re-run the install command for your distro.

EACCES or permission errors during npm install -g

You're hitting npm's classic global-install permission problem. Two fixes:

Browser doesn't open on a headless box

Claude prints a sign-in URL. Copy it, open it on any machine with a browser, sign in. The terminal that printed the URL detects success and continues.

WSL2 — works but feels weird

WSL2 is fine. A few notes: file edits Claude makes are real Linux files (use /mnt/c/... if you want to touch the Windows side). Browser auth opens your Windows default browser; sign in there.

Corporate proxy / firewall

Set HTTPS_PROXY in your shell before running Claude. Most enterprise setups also need npm's proxy: npm config set proxy http://... and npm config set https-proxy http://....

What's next

The fastest learning curve is doing real work. Pick something annoying you've been putting off — renaming 200 files, sorting a messy folder, fixing a flaky shell script — and let Claude do it while you watch. The shape of when-to-use-it gets obvious in about an hour.