# How to Install Claude Code on macOS & Linux

> Install Claude Code with the curl script or Homebrew in under a minute. The npm route now needs Node.js 22+, and a paid Claude plan is required.

- Canonical: https://guides-ai.pages.dev/guides/install-claude-code-macos-linux/
- Plate 01.02 · Topic: Install & set up (https://guides-ai.pages.dev/topics/setup/)
- Published: 10 Jun 2026 · Updated: 06 Sept 2026 · 3 min read
- Source site: guides-ai — https://guides-ai.pages.dev/

**You need:** macOS 13.0+ or Ubuntu 20.04+ / Debian 10+ (Alpine and RHEL also supported), 4 GB
RAM, and a **Claude Pro, Max, Team, Enterprise or Console account**. The free Claude.ai plan
does not include Claude Code.

## 1. Run the native installer

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

What it does: installs the native binary and sets up background auto-updates. This is the
recommended route on macOS, Linux and WSL.

```bash
brew install --cask claude-code
```

What it does: installs via Homebrew instead. Two casks exist — `claude-code` tracks the stable
channel (about a week behind, skipping bad releases) and `claude-code@latest` tracks every
release. Homebrew installs **do not auto-update**: run `brew upgrade claude-code`.

npm still works, but note the change: **as of v2.1.198 the npm package requires Node.js 22 or
later.** It installs the same native binary, which doesn't use Node at runtime.

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

What it does: installs globally through npm. Never prefix this with `sudo`.

## 2. Verify the install

```bash
claude --version
```

What it does: prints a version number followed by `(Claude Code)`. If your shell says
`command not found`, close and reopen the terminal so PATH is picked up — and if it persists,
see [fix "claude: command not found"](/guides/fix-claude-command-not-found/).

```bash
claude doctor
```

What it does: prints read-only install and settings diagnostics — install health, settings-file
validation errors, and the result of the last update attempt — without starting a session.

## 3. Open your project and log in

```bash
cd ~/path/to/your/project
claude
```

What it does: starts an interactive session scoped to that folder. A browser opens on first
run; sign in with your Claude account, or choose Claude Console to use API billing. Type
`/login` inside a session to switch accounts later.

## If it fails

A `syntax error near unexpected token '<'` or a 403 from the curl command means the script
didn't download — you got an error page instead. Check your network can reach `claude.ai` and
retry rather than piping the result to bash again.

Native installs auto-update in the background; Homebrew and package-manager installs don't. See
[how to update Claude Code](/guides/update-claude-code/) for the manual commands. Once you're
in, [your first session](/guides/first-claude-code-session/) covers what to do with the
[agent](/glossary/#agent) now sitting in your repo.

Source: [Claude Code advanced setup](https://code.claude.com/docs/en/setup).
