Install Claude Code

The install commands from Anthropic's official docs for macOS, Linux, WSL and Windows, how to tell PowerShell from CMD, how to check it worked, how updates work, and what to do when your terminal cannot find it.

Beginner8 min readUpdated November 29, 2026

Before you start

Everything in this lesson comes from Anthropic's Claude Code documentation, as we read it on November 29, 2026. The commands are copied from those pages. Install commands can change, so compare with the setup page linked at the end before you run anything, and only run install commands from Anthropic's own site.

You will need:

  • A supported system. Anthropic's setup page lists macOS 13.0 or later; Windows 10 1809 or later, or Windows Server 2019 or later; Ubuntu 20.04 or later; Debian 10 or later; and Alpine Linux 3.19 or later, with at least 4 GB of RAM and an x64 or ARM64 processor.
  • An internet connection.
  • An account that includes Claude Code, which the setup page says means a Pro, Max, Ultra, Team, Enterprise or Console account, or access through a supported cloud provider. It says the free Claude.ai plan does not include Claude Code access. You sign in after installing, so you can install first.
  • A terminal. If you have never used one, Anthropic's docs link to a terminal guide that shows how to open one and paste a command.

If you would rather not use a terminal at all, Anthropic's setup page points to its desktop app, which includes Claude Code and needs a paid subscription. The rest of this lesson is about the command-line version.

Choose an install method

Anthropic lists a recommended native installer, plus Homebrew and WinGet as alternatives, and package managers for some Linux systems. For most people, the native installer is the right choice, because, as the docs note, native installations update themselves in the background. Homebrew and WinGet installs do not update automatically by default, so you have to remember to upgrade them.

macOS, Linux and WSL

Open a terminal and run the native installer:

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

This one line downloads Anthropic's install script and runs it. The docs warn that the install command shows no progress while it downloads, so do not worry if it seems to sit still for a moment.

WSL means the Windows Subsystem for Linux, a way to run Linux inside Windows. If you use it, run this command inside your WSL terminal, not in PowerShell or CMD, and launch Claude Code from inside WSL too.

On Alpine Linux and other musl-based systems, the setup page says the installer needs bash and curl, which Alpine does not include by default. It gives this command to install them first:

apk add bash curl

Windows: PowerShell or CMD

On Windows you can install Claude Code natively, or inside WSL as above. Anthropic's setup page compares them: native Windows needs nothing extra, while WSL 2 supports sandboxed command execution and suits projects that use Linux tools.

For a native install, first work out which shell you are in. The docs give a simple test: in PowerShell your prompt starts with PS, like PS C:\, and in CMD it shows C:\ without the PS.

In PowerShell:

irm https://claude.ai/install.ps1 | iex

In Command Prompt (CMD):

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

The setup page says you do not need to run these as Administrator.

If you run the wrong one, the error tells you. The docs say that if you see "The token '&&' is not a valid statement separator", you are in PowerShell, not CMD; and if you see "'irm' is not recognized as an internal or external command", you are in CMD, not PowerShell. Switch to the other command.

The docs also recommend Git for Windows on native Windows so Claude Code can use its Bash tool. Without it, they say Claude Code uses PowerShell to run commands instead. WSL setups do not need Git for Windows.

Homebrew or WinGet instead

If you already manage software with Homebrew on a Mac, the docs give:

brew install --cask claude-code

Anthropic's page says Homebrew offers two casks: claude-code follows the stable release channel, which is typically about a week behind and skips releases with major regressions, while claude-code@latest gets new versions as soon as they ship.

On Windows with WinGet:

winget install Anthropic.ClaudeCode

Remember that these do not update themselves by default. The docs give the upgrade commands: brew upgrade claude-code (or brew upgrade claude-code@latest, depending on which cask you installed) for Homebrew, and winget upgrade Anthropic.ClaudeCode for WinGet.

Anthropic also mentions installing with apt, dnf or apk on Debian, Fedora, RHEL and Alpine. Those steps are on the setup page.

Check that it worked

When the installer finishes, open a new terminal window. A new window matters, because the old one may not know about the newly installed program yet. Then run:

claude --version

According to the quickstart, a working installation prints a version number followed by "(Claude Code)". The exact number does not matter; it changes with every release.

For a fuller check, the setup page describes a diagnostic command that prints read-only information about your installation and settings without starting a session:

claude doctor

If the terminal cannot find it

The most common problem is a message saying claude is not found or not recognized. The docs explain that this means the install directory is not on your PATH yet. PATH is the list of folders your terminal searches for programs.

Try these in order:

  1. Open a new terminal window and try again. This fixes it surprisingly often.
  2. Follow the "Fix your PATH" section on Anthropic's setup or troubleshooting pages, which has the steps for each system.
  3. Match the exact error. The docs say that if the install fails with "syntax error near unexpected token '<'", a 403 or any other error, its troubleshooting page matches each error to a fix and lists alternative install methods.

Do not paste install commands from random forums or videos to fix a failed install. Use Anthropic's troubleshooting page.

Worked example: a Windows install, start to finish

Here is how a typical native Windows install goes, following the docs.

  1. Open PowerShell. If you are not sure how, Anthropic's terminal guide shows the way. Check that the prompt starts with PS, so you know you are in PowerShell and not CMD.
  2. Paste irm https://claude.ai/install.ps1 | iex and press Enter. Nothing seems to happen for a little while; the docs say the installer shows no progress while it downloads.
  3. When it finishes, close that window and open a new PowerShell window.
  4. Run claude --version. A version number followed by (Claude Code) means it worked.
  5. If you plan to work on projects that use Bash scripts, install Git for Windows, which the docs recommend so Claude Code can use its Bash tool.
  6. Go to a project folder with cd and type claude to start your first session and sign in.

If step 4 says claude is not recognized, open one more new window and try again before anything else. If it still fails, follow the PATH steps on Anthropic's troubleshooting page.

Updates

The setup page says native installations check for updates on startup and while running, download them in the background and apply them the next time you start Claude Code. You can also choose a release channel: latest, the default, for new features as soon as they are released, or stable, for a version that is typically about a week old and skips releases with major regressions.

Homebrew, WinGet and Linux package manager installs need manual updates by default, using the commands above.

After installing: sign in

The install is done, but you still need to sign in. The quickstart says Claude Code prompts you to log in on first use: you go to a project folder in your terminal, type claude, and follow the prompts, which finish in your browser. The next lesson in this track walks through that first session.

A note on install commands

Commands that download a script and run it straight away, like the curl and irm lines above, are common for developer tools, but they deserve care. Only run them from the official site you trust, check the address is exactly right, and never run a modified version someone sends you. If your workplace manages your computer, check whether you are allowed to install software and which method IT prefers.

Try it

  1. Check your system against the requirements above.
  2. Open the right terminal and run the install command for your system.
  3. Open a new terminal window and run claude --version.
  4. If it fails, run claude doctor or follow the troubleshooting steps, then move on to the first session lesson.

Questions people ask

Do I need Node.js or npm?

Not for the recommended native installer in Anthropic's current docs. The setup page still mentions npm in places, for example for removing older npm installs, but the native installer is the method it recommends.

How do I uninstall it?

Anthropic's setup page has an uninstall section for each install method, including how to remove configuration files. Note its warning that removing configuration files deletes your settings and session history.

Can I install it on a work computer?

Technically often yes, but check your company's rules first. Some organisations manage Claude Code centrally, and Anthropic's docs describe managed settings for that.

Which channel should I use, latest or stable?

Anthropic's setup page describes latest as the default, with new features as soon as they are released, and stable as typically about a week old, skipping releases with major regressions. If you value predictability over new features, stable is a reasonable choice. The setup page shows how to change it.

Sources: Claude Code docs: Advanced setup · Claude Code docs: Quickstart · Claude Code docs: Overview