Install Claude Code: Complete Setup Guide (2026)

/ Get Claude Code Running in Minutes.

Published: July 10, 2026 at 11:00 AM EDT | Updated: July 14, 2026 at 11:32 AM EDT
How to install Claude code
Image: Alison Parker / TheTweaks, Anthropic

Quick Answer:  You need to open your terminal and run the native installer command from code.claude.com — irm https://claude.ai/install.ps1 | iex on Windows PowerShell, or curl -fsSL https://claude.ai/install.sh | bash on Mac and Linux. Make sure you have Node.js 18+ (optional if you use npm), have a Claude Pro, Max, Team, or Console account and have around 200 MB of free disk space. After installation, simply run claude in any folder to log in and begin your first session.

Testing note: We installed Claude Code using the native installer on Windows 11 (24H2), macOS Sonoma 14.6 and Ubuntu 24.04 in July 2026. Every command in this guide was verified before publication and the errors covered below are ones we actually hit during testing, not a generic list copied from documentation.

Key Takeaways

  • Claude Code can now be installed using a native installer and does not require Node.js — it’s the installation method recommended by Anthropic for 2026
  • The free Claude.ai plan does not include Claude Code — you need Pro, Max, Team, Enterprise, or a Console (API) account
  • Windows users can install natively through PowerShell or through WSL — we’ll help you decide which
  • The most common installation problem on all OSes is the same — missing claude command due to a PATH issue
  • We installed Claude Code on Windows 11, macOS Sonoma and Ubuntu in this guide and every command below is tested, not copied from the docs

 

If you have been delaying getting started with Claude Code because installation “sounds technical,” we understand. We installed it freshly across three operating systems while preparing this guide and honestly, the installation takes less than two minutes on all platforms. What gets people stuck is the part after installation, when their terminal returns claude: command not found and they don’t understand why. We will walk you through that as well.

This guide covers how to install Claude Code on Windows, Mac and Linux, how to verify installation, how to log in and how to resolve the errors that occur in actual installations, not a generic, clean installation guide where nothing ever goes wrong.

What Is Claude Code

Claude Code is a command line AI coding tool by Anthropic. Instead of copy pasting your code between a chatbot and your editor, you run Claude Code directly inside your project folder in the terminal and it can read files, edit code, run terminal commands, explain code, generate tests and automate many development tasks in response to plain English instructions you type.

It is different from using Claude in your browser in one significant way — Claude Code has access to your project’s files and can modify it after requesting your approval.  with your permission on every action.

Think of Claude Code not as a chatbot but as a very fast junior developer sitting at your keyboard, ready to act according to your instructions.

Claude Code runs on Windows, macOS and Linux, as well as in VS Code and as a desktop application with a GUI. This guide covers the terminal (CLI) version of Claude Code, which is what most people mean when looking up “how to install Claude Code” on Google.

Requirements Before Installing Claude Code

Check the following requirements before running the installation command. Skipping this step is the number one reason why Claude Code installation fails when it is technically not and nothing works because of a missing requirement.

Requirement Details
Operating System Windows 10 (1809+) or Windows 11, macOS 13 (Ventura) or later, Ubuntu 20.04+/Debian 10+
RAM Minimum 4GB, recommended 8 GB for larger projects
Disk Space About 200MB for the CLI and cache
Internet Required Claude Code communicates with Anthropic’s servers, no local processing needed
Node.js Only if you install via npm (v18+); native installer does not need Node.js
Account Claude Pro ($20/mo), Max, Team, Enterprise, or Console (API) account
Git Optional but highly recommended Claude Code works much better in a Git repository

The most missed requirement when people try to install Claude Code: The free plan of Claude.ai does not include Claude Code. You need at least a Pro subscription or a Console (API) account, if you want to pay per token.

We have seen numerous beginners installing Claude Code successfully, only to get stuck at login because they thought the free account would be sufficient.

You also do not need any hardware except the operating system. All of the actual AI processing happens on Anthropic’s server and your computer just runs a lightweight CLI client that sends your requests through the Internet.

Native Installer vs NPM: Which One Should You Use

Claude Code offers you two ways to install it. Almost every online guide skips explaining the differences between these two. Let’s look at it realistically based on the results of testing on all three operating systems.

Factor Native Installer NPM Install
Requires Node.js No Yes (v18+)
Auto-updates Managed automatically by the installer  No manual updates required
Anthropic’s recommended installation Yes, this is how they test it Supported, but secondary
Best for Most users, including beginners Developers managing everything via npm
Install command (Mac/Linux) curl -fsSL https://claude.ai/install.sh | bash npm install -g @anthropic-ai/claude-code

Our recommendation: Unless you have a reason to install everything via npm, opt for the native installer. It is one less dependency to manage and the auto update feature alone saves you from reinstalling the CLI every couple of weeks. We switched from npm to native installation halfway through testing this guide and haven’t regretted it.

Important warning: Never run the npm install command with sudo. A sudo npm install -g is the most common cause of permission errors down the road and it is also a security risk you do not need to take.

How to Install Claude Code on Windows

There are two ways to install Claude Code on Windows: using PowerShell or installing it through WSL (Windows Subsystem for Linux). If you do not have other development related reasons to use WSL, stick to PowerShell, it is simpler to set up and works fine for most people. Only consider using WSL if your projects reside in Linux.

Installing Git First (recommended)

Claude Code works better with Git installed, since it will be able to access the file changes and history. Open PowerShell and check if you already have Git:

Powershell

git -v

If you lack it, download Git for Windows from git-scm.com, install it and choose the default settings.

Native Windows installation

Open PowerShell. No need to run it as Administrator. Then enter:

Powershell

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

This command will download and install Claude Code. The entire process, from downloading to install and configuration message appeared in our test on a clean Windows 11 machine in less than a minute.

If you see an error similar to The token ‘&&’ is not a valid statement separator in PowerShell, you’re actually in Command Prompt (CMD), not PowerShell. You can recognize it by your prompt, PowerShell has PS C:\, CMD has only C:\. If you are stuck in CMD, use WinGet instead:

cmd

winget install Anthropic.ClaudeCode

Adding Claude Code to PATH

If you see a message about the install location after installation and typing claude command gives you nothing, you need to manually add that folder to PATH:

  • Search “environment variables” in the Windows search bar
  • Click “Edit the system environment variables”
  • Click Environment Variables
  • Under Path, click Edit → New and paste the install location displayed in your terminal
  • Click OK on both windows
  • Close PowerShell completely and reopen it

 

And yes, this one step will solve the most common Windows installation problem we’ve encountered across every forum and comment section on this topic.

How to Install Claude Code on macOS

Mac installation is the easiest of the three, especially if you are using Homebrew.

Option 1: Native Installer (recommended)

Open Terminal (search it with Spotlight, Cmd + Space) and enter:

Bash

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

After the installation is completed, you will usually see a message with instructions on adding the install location of Claude Code to your shell configuration. Copy it and enter it, usually this command updates your ~/.zshrc file. Then reload it:

Bash

source ~/.zshrc

Add

source ~/.bashrc

For bash users

Option 2: Homebrew

If you already manage your development tools through Homebrew:

Bash

brew install –cask claude-code

Keep in mind that Homebrew installation does not have auto updates. You will need to enter brew upgrade claude-code  yourself every so often to stay current.

Apple Silicon vs Intel

The install commands are identical on both platforms. The only difference appears in Homebrew install where package paths are usually located under /opt/homebrew on Apple Silicon, compared to /usr/local on Intel Macs. If you get a “command not found” error after Homebrew installation, this is probably the reason.

How to Install Claude Code on Linux

Yes, Claude Code is fully supported on Linux, including Ubuntu, Debian, Fedora, RHEL and Alpine Linux through native package managers, as well as using curl and npm universally.

Before the installation, it is a good idea to check your existing development tools, as most Linux development machines already have everything that you need:

Bash

git -version
curl –version
node -v
npm -v

Java and Python are optional and not required for Claude Code.

Installation via curl (recommended)

Bash

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

This will require an active internet connection, since the installation script downloads the package. When it is done, you will see a message about successful installation along with the version number and the install path.

Installation via npm (alternative)

Bash

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

Alpine and musl based distributions

Alpine Linux requires a couple of additional packages before native installation will work correctly:

Bash

apk add libgcc libstdc++ ripgrep
export USE_BUILTIN_RIPGREP=0

Verifying Your Claude Code Installation

Regardless of the OS and the method used, always make sure your installation went smoothly before continuing.

Bash

claude –version

You should see a version number. For a more detailed verification that catches PATH issues, permission errors and configuration errors in one go, run:

Bash

claude doctor

We ran claude doctor after every installation during this guide preparation and it turned out to be quite useful. It pointed to a PATH issue on our Windows machine even before we opened a project.

Opening Claude Code and Logging In for the First Time

Enter your project folder (or create a new one):

Bash

mkdir my-project
cd my-project
claude

The first time you do it, Claude Code will:

  • Show you the choice of theme light or dark
  • Print out the security note saying that Claude Code can make mistakes and warning against executing untrusted code
  • Ask you to trust the current folder choose Yes, I trust this folder
  • Ask you to log in

 

Log in will automatically open your default browser. If it does not open, which happened to us once while installing on Linux, Claude Code prints the link to your login page. Copy the link in the terminal, open it in any browser manually and sign in there.

Then, you will be asked to choose between logging in with a Claude account (works for Pro, Max, Team, Enterprise subscription plans) and with a Console account (pay-per-token API billing). For most individual developers, the former option is more cost effective. After authorizing in the browser, go back to the terminal and press Enter.

Basic Setup After Installation

When you are logged in, you will appear inside the Claude Code interface with a model already selected, usually Sonnet. You can type /model to change between available models (e.g., Opus or Sonnet, depending on your plan).

After Claude Code launches, try to type hello to ensure everything is working.

Or a more practical example:

Create a basic index.html file for me

Claude Code will generate the file and ask for your permission before creating it. This permission request is intentional, so that it does not accidentally edit your files.

How to Update Claude Code

Update commands depend on the initial installation method.

Install Method Update Command
Native installer Auto-updates in the background
Homebrew brew upgrade claude-code
WinGet winget upgrade Anthropic.ClaudeCode
npm npm install -g @anthropic-ai/claude-code@latest

If you used the native method to install Claude Code, you usually do not need to bother about it. This is one of the advantages of that approach. If you choose npm, avoid npm update -g, it respects the version range of your original installation and might not actually upgrade to the latest version. Explicit use of @latest is more secure.

How to Fix “Claude Command Not Found” Error

This is the most common issue across all platforms and it is pretty much the same root cause almost every time your terminal does not know where the claude command is stored. How to fix it depends on your initial installation method.

On Windows: Use the PATH steps from the Windows installation chapter above and add the install location to your system PATH, then restart PowerShell completely.

On Mac/Linux, if you used the native installer:

Bash

echo ‘export PATH=”$HOME/.local/bin:$PATH”‘ >> ~/.zshrc

source ~/.zshrc

On Mac/Linux, if you used npm:

Bash

echo ‘export PATH=”$(npm config get prefix)/bin:$PATH”‘ >> ~/.zshrc

source ~/.zshrc

If you are using Bash instead of Zsh, replace ~/.zshrc with ~/.bashrc in the command above.

Quick Tip: Always close and open your terminal after updating PATH. Just opening a new tab in the same terminal window does not usually reload the environment properly. It got us during testing and took more time to figure out than the actual fix.

Common Installation Errors and Their Solutions

Here is every error we ran into while testing this guide across all three operating systems, as well as the most popular ones in developer forums.

Error Likely Cause Where It Happens
command not found after install Not added to PATH Windows, Mac, Linux
‘irm’ is not recognized In CMD, not in PowerShell Windows
EACCES permission error Installed with sudo npm Mac, Linux
Browser does not open for login Security setting in Browser/OS All platforms
Node version error Node below v18 All platforms (npm install only)
Install works but Claude “forgets” things between sessions Memory file not configured All platforms

How to Resolve Them

command not found after install

It is almost always the PATH issue. Add the install location to PATH using the instructions above for your system: system PATH on Windows, ~.local/bin on Mac and Linux for native installs or npm’s global bin directory for npm installs.

‘irm’ is not recognized

You are actually in Command Prompt, not PowerShell. Either open PowerShell (search it in the Start menu) or stay in CMD and use WinGet:

cmd

winget install Anthropic.ClaudeCode

EACCES permission error

It happens because Claude Code was installed with sudo npm install -g. Uninstall it, then reinstall without sudo. If the error persists, configure the default global directory for npm instead of using sudo once again, sudo installs are the cause of most permission issues, not a one time fix.

Browser does not open for login

This occurred once during our Linux installation. Claude Code prints the login URL in the terminal automatically when the browser fails to launch. Copy the link printed by Claude Code and paste it into any browser manually. Sign in normally.

Node version error

Upgrade Node using nvm (Node Version Manager) instead of direct installation, as nvm allows to switch versions easily without leaving behind old files:

Bash

nvm install –lts
nvm use –lts

Or avoid Node completely and switch to native installation method that does not require it.

Claude “forgets” things between sessions

This is not a bug, this is the expected default behavior. Claude Code does not remember anything across the sessions unless you configure a memory file yourself. That is a separate configuration step, not an installation one.

If none of the solutions work, run claude doctor, it detects most of the environment issues automatically and tells you exactly what is misconfigured.

Final Verdict

Installation of Claude Code takes less than two minutes on any of the three main operating systems and honestly, the installation itself is much easier than most terminal tools we have installed. The problem is not in the installation command itself, it is in the PATH configuration that follows.

Our recommendation after testing all three platforms: use the native installer, unless you have reasons to prefer npm, run claude doctor immediately after installation and do not skip checking your account plan before logging in. Do these three things correctly and you will be writing your first prompt inside Claude Code in under five minutes.

Frequently Asked Questions

Yes. The native installer needs no Node.js at all. Node is only required if you choose the npm install method instead.
No. Claude Code sends every request to Anthropic's servers for processing, so an active internet connection is required for it to function at all.
Run claude --version to confirm it's installed, then run claude doctor for a full diagnostic check covering PATH, permissions, and configuration issues.
Most Related