Claude Code guide · Chapter 3 of 10

How to install Claude Code on Mac, Windows and Linux, step by step

Claude Code installs with a single command in the terminal and updates itself: one command for Mac, Linux and WSL, and another for PowerShell on Windows. If you don't want the terminal, the desktop app already includes it. Here are the commands for each system, how to check it works, your first session, how to update or remove it, and what to do if something fails.

By · 14 min read · Beginner · · 7 sources

Cover of chapter 3 of the Claude Code guide, “Install Claude Code”, with a terminal with the install command, a full progress bar and the version number, and a portrait of Javier Sáez Hurtado
Chapter 3 of 10 · See all
  1. Claude Code vs Cowork
  2. Where Claude Code runs
  3. Install on Mac, Windows and Linux
  4. VS Code, Cursor and JetBrains
  5. On the web, with GitHub
  6. Cloud environments
  7. Over SSH and in Docker
  8. On mobile
  9. Security
  10. Case study

Install Claude Code: 6 quick answers

What people ask most before they install it, with a short answer. Everything here was checked in the official documentation on November 18, 2026.

  • What is the command? On Mac, Linux and WSL: curl -fsSL https://claude.ai/install.sh | bash. On Windows, in PowerShell: irm https://claude.ai/install.ps1 | iex.
  • What do I need? macOS 13 or later, Windows 10 (version 1809) or 11, or Linux (Ubuntu 20.04, Debian 10 or Alpine 3.19, or later), 4 GB of RAM, an internet connection, and to be in a country where Anthropic offers its service.
  • Is it free? The program is free to install, but you need a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account with credit to use it. Pro costs $20 a month, or $17 a month billed annually ($200 up front), before sales tax. The Free plan does not include it.
  • How long does it take? A couple of minutes. The installer shows no progress while it downloads, so wait for it to finish.
  • Does it update itself? The native install does, in the background. Homebrew and WinGet installs must be updated by hand.
  • What if I don’t want to use the terminal? Download the Claude desktop app and open the Code tab. Claude Code is already inside.

If you first want to know what Claude Code is and where it can run, read where Claude Code runs. This chapter is only about installing it well on your computer.

Before you start: what you need

Claude Code is a program that runs in a terminal. You don’t need to know how to code to install it, but you do need to open a terminal and paste a command. This is what the official documentation asks for:

You need Details
System macOS 13.0 or later; Windows 10 1809 or later, or Windows Server 2019; Ubuntu 20.04, Debian 10 or Alpine Linux 3.19, or later
Computer 4 GB of RAM or more, with an x64 or ARM64 processor (Apple silicon Macs work too)
Shell Bash, Zsh, PowerShell or CMD
Network An internet connection, from a country where Anthropic offers its service
Account A Pro, Max, Ultra, Team or Enterprise plan, or a Claude Console account
Screenshot of the Claude Code documentation with the system requirements: macOS 13.0 or later, Windows 10 1809 or Windows Server 2019, Ubuntu 20.04, Debian 10 or Alpine 3.19, 4 GB of RAM with an x64 or ARM64 processor, an internet connection and Bash, Zsh, PowerShell or CMD
The system requirements, from the official documentation. Screenshot of code.claude.com, Nov 18, 2026 (source).

Two more details. Git is optional but strongly recommended: with it, Claude Code can save versions of your project, create branches and undo changes safely. And you don’t need Node.js for the native install: the installer brings its own runtime. Node.js 22 or later is only needed if you choose to install with npm.

If you have never opened a terminal: on a Mac it is the Terminal app (search for it with Spotlight); on Windows it is PowerShell (type “PowerShell” in the Start menu). You don’t need to run it as administrator.

Step 1: run the installer for your system

The recommended way is the native install: one command that downloads Claude Code, puts it in your user folder and keeps it up to date. Pick your system:

Open the Terminal app and paste:

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

The program goes to ~/.local/bin/claude. If you prefer Homebrew, run brew install --cask claude-code, which follows the stable channel (about a week behind the latest release). Homebrew installs don't update on their own: run brew upgrade claude-code.

Open PowerShell (you will see PS C:\ at the start of the line) and paste:

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

If you are in CMD (the line starts with C:\, without PS), the command is different:

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

With WinGet: winget install Anthropic.ClaudeCode, which does not update on its own either (winget upgrade Anthropic.ClaudeCode). You don't need admin rights. Also install Git for Windows, so Claude Code can use Bash; without it, Claude Code uses PowerShell.

On Ubuntu or Debian, open the terminal and paste:

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

On Alpine and other musl-based distributions, install bash and curl first, since they don't come by default:

apk add bash curl

There are also packages for apt, dnf and apk. Those don't update on their own and need admin rights to do it.

Open your WSL distribution (Ubuntu, for example) and run the Linux command inside WSL, not from PowerShell:

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

Then start claude from the WSL terminal too. WSL 2 gives you sandbox mode, which isolates commands; native Windows does not have it. WSL doesn't need Git for Windows.

Screenshot of the Claude Code documentation with the native install commands: curl for macOS, Linux and WSL, irm for Windows PowerShell and curl with install.cmd for Windows CMD, with the Homebrew and WinGet tabs
The official install commands for each terminal. Screenshot of code.claude.com, Nov 18, 2026 (source).

Native Windows or WSL?

The documentation gives a simple rule: it depends on where your projects live and which tools you use.

  • Native Windows if your projects and tools are Windows ones. You don’t need anything else; Git for Windows is optional but recommended.
  • WSL 2 if you work with Linux tools or want commands to run isolated in a sandbox. WSL 2 must be enabled.
  • WSL 1 only if you can’t use WSL 2: it has no sandbox.
Recreation of Windows PowerShell with the irm install command, the successful install message, claude --version showing version 2.1.327 and claude doctor with auto-updates on and Git Bash found
Installing on Windows with PowerShell and checking with claude doctor. Approximate recreation with sample data: the installer messages may vary.

Other ways to install it

  • npm: npm install -g @anthropic-ai/claude-code@latest. It needs Node.js 22 or later and installs the same program as the native installer. Never use sudo: it causes permission and security problems, and then it can’t update itself.
  • A specific version: the native installer accepts a version number, which helps if your team wants everyone on the same one.
  • No terminal: the Claude desktop app for macOS and Windows (Linux is in beta). Sign in, click the Code tab, pick your folder and you’re set. You don’t need Node.js or the terminal program. I go through each system step by step in how to download and install Claude Desktop.

Step 2: check that it works

Close the terminal, open a new one and type:

claude --version

If everything went well, you get a version number followed by “(Claude Code)”. On December 2, 2026, the latest published version was 2.1.334 (released December 1, according to the npm registry), and the stable channel was on 2.1.331. A new version comes out almost every day, so your number will be different.

For a fuller check, without opening a session:

claude doctor

claude doctor tells you how it is installed, whether auto-updates are on, whether your settings files have errors and, if something is wrong, what to do. It is the first thing to run when something doesn’t work.

Step 3: your first session and sign-in

Go to your project folder and start Claude Code:

cd path/to/your/project
claude

The first time, it asks you to sign in. Choose your account type, the browser opens, you sign in with your Claude account and go back to the terminal. Your credentials are saved, so you won’t have to do it again. To switch accounts later, type /login inside the session.

Recreation of the macOS Terminal with the curl install command, claude --version showing version 2.1.327, moving into a sample project folder and the Claude Code welcome screen asking you to choose a sign-in method
From install to first session on a Mac. Approximate recreation with sample data: the user, the folder and the installer messages are made up.

You can sign in with:

  • A Claude subscription (Pro, Max, Ultra, Team or Enterprise). This is the recommended and simplest option.
  • A Claude Console account, with prepaid credit. The first time, a workspace called “Claude Code” is created so you can track spending.
  • A cloud provider (Amazon Bedrock, Google Cloud or Microsoft Foundry), if your company works that way.

If the browser doesn’t open (this happens in WSL 2, over SSH or inside a container), the terminal shows a sign-in link. Open it in your computer’s browser, sign in, copy the code you get and paste it into the terminal where it says Paste code here. You can also use claude auth login.

Once you’re in, you see the version, the model and the folder you are working in. Three commands to start with:

Command What it does
/help Shows the available commands
/resume Picks up an earlier conversation
/exit Quits Claude Code (Ctrl+D twice works too)

And from the terminal, claude -c continues the last conversation in that folder.

Update Claude Code

The native install updates itself. Claude Code checks for new versions when it starts and from time to time while it runs; it downloads them in the background and applies them the next time you open it. To update right now:

claude update

With Homebrew or WinGet it’s not automatic: run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode. If you want Claude Code to do it for you, the variable CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 lets it run that upgrade in the background.

Two channels. By default you follow the latest channel, with each version as soon as it ships. If you prefer stability, the stable channel runs about a week behind and skips releases with major bugs. Change it in /config, under Auto-update channel. If you switch to stable, also set a minimum version so you don’t move back to an older one.

Uninstall Claude Code

It depends on how you installed it:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

In PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
brew uninstall --cask claude-code
winget uninstall Anthropic.ClaudeCode
npm uninstall -g @anthropic-ai/claude-code

That removes the program, but not your settings. If you want to remove everything, the ~/.claude folder and the ~/.claude.json file hold your settings, the permissions you’ve granted, your MCP servers and your session history. Deleting them can’t be undone. And if you have the VS Code extension, the JetBrains plugin or the desktop app, remove them first: they also write to ~/.claude/ and will create it again.

Common errors and how to fix them

The documentation has a table that matches each error message with its fix. These are the ones you’ll see most:

Screenshot of the “Find your error” table in the Claude Code documentation, which matches messages such as command not found, permission denied, syntax error near unexpected token or curl 403 with their fix
The official table that matches each install error with its fix (first rows). Screenshot of code.claude.com, Nov 18, 2026 (source).
  • command not found: claude or 'claude' is not recognized. The install worked, but the folder with the program is not in your PATH (the list of folders where the terminal looks for programs). First, open a new terminal. If it still fails, add the folder. On a Mac with Zsh: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc, then source ~/.zshrc. On Windows, the folder is C:\Users\your-user\.local\bin. The installer already warns you at the end with a note that says “Native installation exists but … is not in your PATH”.
  • irm is not recognized or The token '&&' is not a valid statement separator. You pasted the PowerShell command into CMD, or the other way around. Look at how the line starts: PS C:\ means PowerShell.
  • syntax error near unexpected token '<' or a 403 error. The installer downloaded a web page instead of the script. It is usually a company proxy or network filter, or you are in a country without service.
  • EACCES: permission denied. A permissions problem in the install folder, almost always from using sudo with npm. Reinstall with the native installer, without sudo.
  • Killed on a small Linux server. Not enough memory. Free up memory or add swap space and try again.
  • Certificate or proxy errors at the office. If your company uses a proxy, set it with the HTTPS_PROXY variable (for example, export HTTPS_PROXY=https://proxy.company.example:8080). If it inspects traffic with its own certificate, Claude Code already trusts your system certificate store; if that is not enough, point to the certificate with NODE_EXTRA_CA_CERTS. To check that you can reach the download server: curl -sI https://downloads.claude.ai/claude-code-releases/latest, which should return 200.
  • Auto-update failed · Run claude doctor in red. The automatic update failed. Run claude update from the terminal.

If your error is not here, claude doctor from the terminal or /doctor inside a session checks the install and tells you what to do.

What I would keep in mind

Installing Claude Code is quick; what deserves some thought is how you will use it.

  • I would use the native install. It is the recommended one, it updates itself and it doesn’t depend on Node.js. Homebrew or WinGet only if you already manage everything that way and you remember to update.
  • On Windows, I would install Git for Windows from day one. It saves you trouble and lets Claude Code use the same tools the documentation assumes. And if you work with Linux tools, I would go straight to WSL 2.
  • I would try it first in a folder that isn’t sensitive, with Git set up, so you can undo any change.
  • I wouldn’t use sudo to install anything for Claude Code. If it asks for it, something is wrong.

And if the terminal makes you nervous, that’s fine: the Code tab in the desktop app does the same with a visual interface. Once it is installed, the next step can be using it from your editor or moving it to the cloud so it keeps working when you close your laptop.

FAQ

How do I install Claude Code?

Open a terminal and run the command for your system. On macOS, Linux or WSL: curl -fsSL https://claude.ai/install.sh | bash. In Windows PowerShell: irm https://claude.ai/install.ps1 | iex. When it finishes, open a new terminal and check with claude --version. Then go to your project folder, type claude and sign in through the browser.

How do I install Claude Code on Windows?

Open PowerShell (the line starts with PS C:\) and run irm https://claude.ai/install.ps1 | iex. You don't need to run it as administrator. In CMD, the command is curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. You can also use winget install Anthropic.ClaudeCode. Install Git for Windows too, so Claude Code can use Bash, or use WSL 2 if you work with Linux tools.

How do I install Claude Code on a Mac?

Open the Terminal app and run curl -fsSL https://claude.ai/install.sh | bash. You need macOS 13 or later; it works on Intel Macs and Apple silicon. If you prefer Homebrew, brew install --cask claude-code installs the stable version, but it doesn't update itself: you have to run brew upgrade claude-code.

Do I need Node.js to install Claude Code?

Not with the native installer, which is the recommended one: it brings its own runtime. You only need Node.js 22 or later if you choose to install with npm (npm install -g @anthropic-ai/claude-code@latest), and never with sudo.

Why do I get command not found when I type claude?

The install worked, but the folder with the program is not in your PATH. First open a new terminal. If it still fails, add the folder: on a Mac with Zsh, echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc and then source ~/.zshrc. On Windows, the folder is C:\Users\your-user\.local\bin. The installer warns you at the end if it is missing.

How do I update Claude Code?

If you used the native installer, it updates itself in the background; to do it now, run claude update. With Homebrew, run brew upgrade claude-code; with WinGet, winget upgrade Anthropic.ClaudeCode. In /config you can pick the latest channel, with each version as soon as it ships, or stable, which runs about a week behind.

Can I use Claude Code without installing anything in the terminal?

Yes. Download the Claude desktop app for macOS or Windows (Linux is in beta), sign in and open the Code tab. Claude Code is already inside: you pick your project folder and work with a visual interface, with no terminal and no Node.js.

How do I uninstall Claude Code?

On macOS, Linux or WSL, run rm -f ~/.local/bin/claude and rm -rf ~/.local/share/claude. On Windows, delete claude.exe and the .local\share\claude folder in your user profile from PowerShell. If you used Homebrew, WinGet or npm, use their uninstall command. Your settings live in ~/.claude and ~/.claude.json: delete them only if you want to lose your settings and history.

Sources

  1. Claude Code Docs, Advanced setup (checked Nov 18, 2026)
  2. Claude Code Docs, Quickstart (checked Nov 18, 2026)
  3. Claude Code Docs, Troubleshoot installation and login (checked Nov 18, 2026)
  4. Claude Code Docs, Enterprise network configuration (checked Nov 18, 2026)
  5. Claude Code Docs, Get started with the desktop app (checked Nov 18, 2026)
  6. npm, @anthropic-ai/claude-code: published versions (checked Nov 18, 2026)
  7. Claude, Plans and pricing (checked Nov 18, 2026)

Javier Sáez Hurtado writes an AI study guide and this Claude Code guide, and uses Claude Code every day, locally and in the cloud. His video lessons are on his YouTube channel, @javiersaezhurtado (in Spanish).

Every fact is checked against the official Claude Code docs on the date shown. Screenshots are of public pages, taken without signing in; screens that need an account are recreations with sample data.