⏱ 8 min read  ·  ✅ Updated Oct 2026

The quickest way to install Claude Code is to open a terminal, run the installer command published in the official setup documentation for your operating system, open a fresh terminal window and check that the claude command is found. An npm-based route also exists for people who already manage Node.js. This guide walks through prerequisites, both routes, sign-in, safe permissions, common errors and a closing checklist.

One caution first. Install commands, supported versions and package names change as software is updated, and this page cannot see the current release. Treat the commands here as the general pattern, and copy the exact current command from the official documentation before running anything in your terminal.

What you need before you start

You need a computer with a terminal, an internet connection, an account to sign in with and enough permission to install software for your own user. Claude Code is a command-line tool that works on files in a folder you point it at, so it helps to have a project directory ready. A sign-in is required either through a subscription account or through a developer API key; the next sections explain the difference.

Requirement Why it matters How to check
Supported operating system Install steps differ between Windows, macOS and Linux Compare against the official requirements page
Terminal access The tool runs in a shell, not as a typical desktop app Open Terminal, PowerShell or your Linux shell
Node.js (npm route only) The npm package needs a supported Node version Run node –version and npm –version
Git (recommended, required on some Windows setups) Useful for project history and needed by some Windows configurations Run git –version
Network access Installation downloads files and the tool calls online services Make sure a proxy or firewall is not blocking it
Account or API key Needed to authenticate Sign in on the provider’s website first

Which install route fits you

There are two broad routes. The native installer is a script you run once; it is meant to set up the tool without asking you to manage a JavaScript runtime. The npm route installs a package globally through Node.js and suits people who already use Node for other work. If you have no strong preference, the route that the official documentation recommends first is the sensible default.

Situation Better fit Reason
No Node.js installed, want the simplest setup Native installer Fewer prerequisites to manage
Node.js already managed with a version manager npm route Fits existing tooling and update habits
Locked-down work computer Ask IT first Policies may restrict scripts or global installs
Windows with Linux tooling needs WSL environment Gives a Linux shell for projects kept there
Dedicated Linux install (see our Linux for gaming setup guide if you are still choosing a distribution) Either route Both generally work from a normal user shell

Step-by-step installation

  1. Open a terminal as a normal user. Avoid opening an administrator or root shell unless the official steps explicitly ask for it.
  2. Check prerequisites. If you plan to use npm, confirm Node and npm respond to their version commands. If either is missing or too old, install a supported version first.
  3. Run the installer for your route. For npm the command follows this pattern, with the current package name taken from the official page:
npm install -g @anthropic-ai/claude-code

For the native installer, copy the one-line command for your operating system from the documentation. On macOS, Linux and WSL it is generally a shell command that downloads and runs a script; on Windows it is generally a PowerShell command. Read what a script does before running it, and only copy it from the official page.

  1. Close and reopen the terminal. This refreshes your PATH so the new command is found.
  2. Verify the command. Run:
claude --version
  1. Move into a project folder and start it. Run claude from inside the directory you want it to work on.

Signing in and managing credentials

On first launch the tool normally prompts for authentication. One route signs in through a browser with a subscription account. Another uses a developer API key from the console, which bills per use. These are different billing arrangements, so decide which one you want before you start. For most people the browser sign-in is the simpler route.

If you use an API key, store it as an environment variable in your shell profile or a secrets manager rather than pasting it into a file in your project. Never commit it to a repository, and rotate it from the console if it ever appears in a log or screenshot. On shared computers, prefer a per-user variable rather than a system-wide one.

Security and file access boundaries

The tool can read files in the folder you launch it from and can propose or run commands. Treat that like giving an assistant access to your working directory. Start it in a project folder, not your home directory or a drive root. Read permission prompts rather than approving everything automatically, and be careful with options that skip prompts. Keep sensitive files such as keys, tokens and personal documents outside the folder, or exclude them using the tool’s documented settings. Work on a branch or a copy when trying something new, so version control lets you review and undo changes.

Common installation errors and fixes

Symptom Likely cause What to try
command not found or not recognized PATH not refreshed, or install folder not on PATH Open a new terminal; check where the installer placed the program and add that folder to PATH
EACCES permission denied during npm install Global npm folder owned by another user Use a version manager or set a user-owned npm prefix; avoid sudo
Unsupported Node version message Node is older than the package requires Install a supported Node release and retry
Download fails or hangs Proxy, firewall or VPN interference Try another network or configure the proxy variables your shell expects
Script blocked on Windows PowerShell execution policy Follow the documented method rather than loosening system-wide policy
Sign-in loop Browser did not return to the terminal, or wrong account Try the manual code option if shown, or sign out and in again

Post-installation verification checklist

  • claude --version prints a version number in a freshly opened terminal.
  • Launching claude in a small test folder reaches the sign-in or main prompt with no errors.
  • Authentication completes and the tool reports which account or key it is using.
  • A harmless request, such as asking it to describe the folder, gets a response.
  • The built-in diagnostic command, where available, reports no path or permission problems.
  • Your API key, if any, lives in an environment variable and not in project files.

If all of these pass, the installation is complete. Updating later usually means rerunning the install command or the tool’s own update command, so note which route you used.

Updating, uninstalling and when to stop and ask for help

Updates depend on the route you chose. An npm install is normally updated by running the install command again or the package manager’s update command, while a native install may update itself or provide its own update command. Check the documentation for your route and avoid installing the same tool through both, because two copies on your PATH can lead to confusing version mismatches. To remove it, reverse the route you used: uninstall the global npm package, or delete the files the native installer placed, following the official uninstall notes.

Stop and ask for help if the installer asks for administrator rights it did not need before, if a script comes from anywhere other than the official documentation, or if your employer manages the computer. On a work machine, a quick message to IT about the tool, the folders it will read and the account it will use is better than working around a policy block. If an error message persists after you fix PATH, permissions and Node versions, copy the full message, the operating system version and the command you ran into the official support channels or issue tracker, which gets you a useful answer faster than a general description.

Related guides

Frequently asked questions

Do I need Node.js to install Claude Code?

It depends on the install route. The npm route requires a supported Node.js version, which the official documentation specifies, while the native installer script is designed to avoid that dependency. Requirements change between releases, so check the current setup page before choosing a route, and run node –version if you plan to use npm.

Should I use sudo with npm install?

Avoid it. Installing a global npm package with elevated rights can leave root-owned files that cause permission errors later. A safer approach is to configure npm to use a folder in your home directory for global packages, use a Node version manager, or use the native installer. If you already ran sudo, fix ownership of the affected folders rather than repeating it.

Can I run it on Windows without WSL?

Support for running directly on Windows has been available through a native route that relies on Git for Windows, while WSL offers a Linux-style environment. Which one suits you depends on where your project files live and which tools you use. Check the current documentation for the officially supported options, since these details have changed over time.

How do I sign in?

On first launch the tool normally walks you through authentication, either with an account tied to a subscription plan or with a developer API key from the console. Pick one route on purpose, because they bill differently. An API key is usually supplied through an environment variable, and it should be stored securely, never inside a repository.

How do I check that it installed properly?

Open a fresh terminal window and run claude –version to confirm the command is found. Then start it inside a small test folder, complete sign-in and ask for something harmless such as a description of the folder. The built-in doctor command, where available, runs diagnostic checks and can flag path or permission problems.

Explore Our Guides & Free Tools