How to install Claude Code on Mac and Windows, then sign in with Pro, Max or Ultra
Install Claude Code with one official command (93-96 seconds in our test), fix command not found, check the connection with claude doctor and sign in
On this page
- 1. Open a terminal and paste the official install command
- 2. Run claude --version and fix your PATH if it's not found
- 3. Run claude doctor to check the connection
- 4. Start claude and choose your subscription account
- 5. Sign in to Claude in your browser and paste the code back
- 6. Give Claude Code its first task in your project
- Fix Claude Code install and sign-in errors by message
We installed Claude Code with the official command on a fresh Ubuntu 24.04 environment (macOS uses the same command). From pressing Enter to "Installation complete" took about a minute and a half in each of three runs (93 to 96 seconds), mostly download time, so your network sets the pace. The install itself is quick; the snags come afterwards, such as the terminal saying it can't find claude. Here's each step in order, mostly with output from our test.
You need a Claude Pro, Max or Ultra plan. Anthropic states that the free plan doesn't include Claude Code; Team, Enterprise and pay-as-you-go Console accounts work too. Your computer needs macOS 13 or Windows 10 version 1809 or later (Ubuntu 20.04+ and Debian 10+ are supported as well) and at least 4 GB of RAM.
You don't need Node.js. Older guides start with installing Node.js and running npm, but the native installer Anthropic recommends now is a standalone binary. If you'd rather not use a terminal at all, install the Claude desktop app: the Code tab at the top of its sidebar is Claude Code with a graphical interface. This guide covers the terminal version.
1. Open a terminal and paste the official install command
Mac: press Command + Space, type "Terminal" and press Return, then paste:
curl -fsSL https://claude.ai/install.sh | bash
Windows: search for PowerShell in the Start menu and open it. You don't need to run it as administrator. Your prompt should start with PS C:\Users\YourName>. Paste:
irm https://claude.ai/install.ps1 | iex
If you opened Command Prompt instead (no PS at the start of the prompt), use this one:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The installer shows no progress bar while it downloads, so it can look stuck. Give it a minute or two. If nothing happens after several minutes, or you get errors like curl: (7), curl: (28) or curl: (35), the connection isn't getting through; see step 3. Here's what it printed in our test:
Homebrew users can run brew install --cask claude-code, and on Windows winget install Anthropic.ClaudeCode works too. Neither updates itself, so you'll need to upgrade by hand now and then. The native installer keeps itself up to date.
On Windows, installing Git for Windows is recommended so Claude Code can run commands through Git Bash. Without it, Claude Code uses PowerShell instead.
2. Run claude --version and fix your PATH if it's not found
First look at the end of the installer output for a Setup notes line saying not in your PATH. The installer doesn't change your PATH, and macOS doesn't include ~/.local/bin by default, so on a Mac you'll most likely see it.
That note means Claude Code is installed but your terminal doesn't know where to find it, so typing claude gives command not found. On a Mac with the default zsh shell, this line fixes it for every new terminal:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
On Linux with bash, replace both instances of ~/.zshrc with ~/.bashrc. Then type claude --version; a version number means you're set:
If the installer didn't show that note, close the terminal, open a new one and type claude --version.
On Windows the program lives in %USERPROFILE%\.local\bin. If a fresh PowerShell window still can't find it, add that folder to your user Path with these two lines and open PowerShell again:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
3. Run claude doctor to check the connection
claude doctor works before you sign in. In a few seconds it prints a checkup covering the install and the network. Look at the two lines under API connectivity: if api.anthropic.com and platform.claude.com both say answered HTTP 200, you're good.
If they say failed, timed out or Connection refused, something between your computer and Anthropic is blocking the connection. To show what that looks like, we pointed the proxy setting at a local port where nothing is listening:
On a work network this is usually the company proxy. Ask IT for its address and set it before starting Claude Code. It has to be an HTTP proxy address starting with http://; Claude Code doesn't support SOCKS proxies.
export HTTPS_PROXY=http://proxy.example.com:8080
export HTTP_PROXY=http://proxy.example.com:8080
In PowerShell:
$env:HTTPS_PROXY="http://proxy.example.com:8080"
Run claude doctor again and continue once both lines show 200. These settings only last until you close the terminal. To keep them, add the export line to ~/.zshrc on a Mac. On Windows, run this and reopen PowerShell:
[Environment]::SetEnvironmentVariable('HTTPS_PROXY', 'http://proxy.example.com:8080', 'User')
If the install command in step 1 hung or failed with Failed to fetch version, set the proxy and run it again.
4. Start claude and choose your subscription account
Go to your project folder first, since Claude Code reads and edits the files in the folder you start it from. If you don't have a project yet, try an empty folder. On Mac and Linux:
mkdir -p ~/my-app && cd ~/my-app
claude
In Windows PowerShell, enter these as three separate lines:
mkdir ~\my-app
cd ~\my-app
claude
The first run asks you to pick a color theme; press Enter for the default. Then it asks how you want to sign in:
- 1. Claude account with subscription: sign in with your Pro, Max or Ultra plan. This is the one you want.
- 2. Anthropic Console account: pay separately for API usage. It's not the same as a subscription.
- 3. 3rd-party platform: Claude through AWS, Microsoft or Google Cloud, mostly used by companies.
5. Sign in to Claude in your browser and paste the code back
After you choose option 1, Claude Code opens the Claude sign-in page in your browser. Sign in and approve access, and the terminal shows Login successful. Press Enter and you're in. If your browser is already signed in to a different Claude account (a free one, say), that's the account you'd be approving, so sign out of claude.ai first.
If no browser opens (common when you're connected to a remote machine), press c in the terminal to copy the sign-in URL and open it in a browser yourself. After you sign in, the page shows a code. Paste it into the box under Paste code here if prompted and press Enter. Copy the whole code, including the # in the middle; a partial code gets you That doesn't look like the full code.
If your Claude account came from AIMacMini, sign in the way your service details describe. For an email account, enter the login email from your service details on the sign-in page, choose to continue with email, and Claude sends a code. Back on AIMacMini, open the Claude plan under My services and click "Show sign-in code" (if the page asks you to confirm it's you, do that first). The code appears within a few seconds. For a Gmail account, choose Continue with Google and use the Gmail address and password from your service details.
Claude Code uses the same account as claude.ai. Try to sign in from the same computer and network you normally use for Claude, rather than hopping between devices. Our article on what to do if your Claude account is banned explains why.
6. Give Claude Code its first task in your project
Once you see the input box, type a request in plain language. In an empty folder, start with something small:
Make a web page called index.html that shows the current time
Claude Code asks before it creates or edits a file or runs a command, so read each request before you approve it. Type /help for the full command list and /status to see which account you're signed in with. Plans have a 5-hour limit and a weekly limit (verified Ultra accounts don't have the 5-hour one), shared between Claude Code and claude.ai; see how Claude usage limits work.
Fix Claude Code install and sign-in errors by message
| What you see | Why | Fix |
|---|---|---|
The install command hangs, or curl: (7), (28), (35) or Failed to fetch version | Can't reach the download server, downloads.claude.ai | Set your proxy (step 3) and install again |
syntax error near unexpected token '<', or curl: (22) ... 403 | The download returned a web page instead of the script; if it mentions App unavailable in region, Claude Code isn't available where your connection comes from | Connect through a network in a supported country, or check your proxy or firewall, then retry |
'irm' is not recognized | You pasted the PowerShell command into Command Prompt | Open PowerShell, or use the Command Prompt line from step 1 |
The token '&&' is not a valid statement separator | You pasted a command with && into PowerShell (the Command Prompt installer, or the Mac mkdir … && cd … line) | Install with the irm command; create the folder line by line as in step 4 |
command not found: claude or 'claude' is not recognized | The install folder isn't on your PATH | Follow step 2, then open a new terminal |
API Error: 403 Request not allowed after signing in | The plan isn't active, or a proxy is interfering | Check your plan at claude.ai/settings; if it's fine, run claude doctor and check your proxy |
This organization has been disabled even though your plan is fine | An ANTHROPIC_API_KEY variable on your computer takes priority over the subscription | On Mac or Linux run unset ANTHROPIC_API_KEY, in PowerShell run Remove-Item Env:ANTHROPIC_API_KEY, then remove it from your shell profile or user environment variables |
| The browser shows a localhost error after signing in | The browser can't hand the login back to the terminal, common over remote connections and in WSL | Sign in with the URL from the terminal and paste the code (step 5) |
If you want Claude Code running around the clock while your own computer is off, put it on a remote Mac. AIMacMini's Mac mini in Korea is a whole machine for one customer, wired to a KT home broadband line, and step 1 of this guide is all it takes to set Claude Code up on it. Use claude.ai on that Mac too, and your sign-ins stay on one machine and one connection. If you still need a plan, AIMacMini's Claude accounts come in Pro, Max and Ultra, with Pro from $69.90.
