Blog · AI tools · Published
How to Install and Log In to Claude Code: Terminal, Desktop, and Cloud
Installing and logging in to Claude Code takes two steps: first confirm your account type (Pro, Max, Ultra, Team, Enterprise, Console, or access through a supported cloud provider; the free version of claude.ai does not include access), then install according to your entry point. For the terminal, use the official native command; if running claude --version prints a version number, the installation succeeded, and the first run of claude guides you through browser login; the desktop app and web entry point follow the page prompts. The article lists system requirements, the difference between native Windows and WSL, verification commands, and troubleshooting order.
Claude Code is Anthropic's coding assistant (an AI assistant that can read project files, edit code, and run commands). To use it, settle two things first: whether you enter from the terminal, the desktop app, or the web, and whether the account type you have is officially supported. For the terminal entry point, install with the official command; if running claude --version prints a version number, the installation succeeded. The first time you run claude in a project directory, it prompts you to complete login in the browser (official quickstart, advanced installation instructions).
1. Confirm Your Account Before You Install
The official authentication section states consistently: Claude Code requires a Pro, Max, Ultra, Team, Enterprise, or Console account, and a free claude.ai account does not include access to Claude Code. In addition to these subscription and Console accounts, you can also connect through supported cloud providers: Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry. If your organization has set up a Claude apps gateway (application gateway, a login entry point configured centrally by an administrator), the administrator will pre-set the gateway address; entering /login opens the Cloud gateway page directly, and you log in with enterprise SSO (single sign-on).
Here is a distinction that is easy to confuse: being able to log in to claude.ai does not mean you can use Claude Code. A free account can register and chat, but to use it, the account type must fall into one of the categories above. When a Console account logs in for the first time, the official service automatically creates a workspace named "Claude Code" to centralize accounting for this portion of the cost.
2. System Requirements: Check Before You Download
| Item | Official requirement |
|---|---|
| Operating system | macOS 13.0+; Windows 10 1809+ or Windows Server 2019+; Ubuntu 20.04+; Debian 10+; Alpine Linux 3.19+ |
| Hardware | 4 GB or more of memory; x64 or ARM64 processor |
| Network | Internet connection required |
| Terminal | Bash, Zsh, PowerShell, or CMD |
| Location | Countries/regions supported by Anthropic |
There are two more dependencies to know about: ripgrep (a search tool) is usually provided along with Claude Code, and the official documentation notes that if search fails, refer to the separate troubleshooting instructions; Git is an optional dependency, and if Git is installed, both claude plugin eval and uploading a local repository from macOS, Linux, or WSL to a cloud session require git 2.31 or later — you can check the version first with git --version.
The location item is a stated operating condition in the official documentation. This article only explains it in terms of officially supported regions and does not involve any method of bypassing regional restrictions.
3. How to Choose Among the Three Entry Points
The official documentation lists the web entry point, desktop app, and terminal as usage methods, with additional editor entry points such as VS Code and JetBrains. The first three are most directly related to installation and login:
| Entry point | When it suits you | How to start | Login and account |
|---|---|---|---|
| Terminal CLI (command-line interface) | Project is local and you are used to typing commands | Run the official install command for your system, then run claude in the project directory |
On first run, log in following the browser prompt; credentials are saved |
| Desktop app | You do not want to open a terminal and want a graphical interface | Download the macOS, Windows, or Linux version from the desktop app entry point in the official documentation | Follow the in-app prompts; for account requirements, see Section 1 |
| Web cloud | You want to use it directly in the browser, or hand a local repository to a cloud session | Open claude.ai/code | Follow the page prompts; uploading a local repository from macOS, Linux, or WSL requires git 2.31 or later |
When choosing, look at two things: where the project is, and whether you are willing to open a terminal. If the project is local and you edit files frequently, the terminal is the most direct; if you do not want to touch the command line, the desktop app is the graphical entry point the official documentation provides; if you only want to use it in the browser, or want to send a local repository to a cloud session, use the web entry point. The official documentation also points people who have never used a terminal to a terminal primer that explains how to open a terminal and how to paste commands; read it first if this is your first installation.
4. Terminal Installation: One Command, Three Checks
- Open a terminal. On macOS and Linux, use the system terminal; on Windows, use PowerShell or CMD. How to tell: if the prompt is
PS C:\, it is PowerShell; if it is justC:\, it is CMD. - Choose the command for your system (native installation, marked as recommended by the official documentation):
- macOS, Linux, WSL (the Linux subsystem inside Windows):
curl -fsSL https://claude.ai/install.sh | bash- Windows PowerShell:irm https://claude.ai/install.ps1 | iex- Windows CMD:curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd - After installation, open a new terminal window and run
claude --version. If it prints a version number followed by(Claude Code), the installation is complete. The official documentation specifically notes: the installation command does not show progress during download, so appearing to sit there without moving does not mean it failed.
If it reports that the command cannot be found, the official explanation is that the installation directory has not yet been added to PATH (the list of directories where the system looks for commands), and there is separate documentation on fixing PATH; there is no need to rush to reinstall.
There are several other official channels for the same thing; choose according to your system and habits:
- Homebrew:
brew install --cask claude-code. The official documentation provides two casks (Homebrew's package form):claude-codefollows the stable channel, andclaude-code@latestfollows the latest channel; installations via Homebrew do not auto-update by default. - WinGet:
winget install Anthropic.ClaudeCode, which likewise does not auto-update by default. - Debian, Fedora, RHEL, Alpine: install using the system package managers apt, dnf, or apk; the official documentation provides signed software repositories.
- npm (the Node.js package manager):
npm install -g @anthropic-ai/claude-code, which requires Node.js 22 or later; the official documentation explicitly warns against usingsudo npm install -g.
Windows: Native or WSL
| Method | Sandbox (runs commands confined to an isolated environment) | When it suits you |
|---|---|---|
| Native Windows | Not supported | Native Windows projects and tools |
| WSL 2 | Supported | Linux toolchains, or when you need sandboxed command execution |
| WSL 1 | Not supported | When WSL 2 is unavailable |
Native Windows installation does not require administrator privileges. The official documentation recommends installing Git for Windows so that Claude Code can use the Bash tool; without it, Claude Code uses PowerShell as the shell tool for running commands. If Claude Code cannot find Git Bash, you can specify the path in settings.json with CLAUDE_CODE_GIT_BASH_PATH. If you use WSL, install and launch claude in the WSL terminal, not in PowerShell or CMD; WSL does not require Git for Windows either.
Alpine and other musl-based distributions have an additional hurdle: the installation command requires bash and curl, and running requires libgcc, libstdc++, and ripgrep. Alpine does not include bash and curl by default; the official approach is to first run apk add bash curl libgcc libstdc++ ripgrep, then set USE_BUILTIN_RIPGREP to 0 in settings.json.
5. Login: With the Right Account Type, One Browser Authorization Is Enough
After installation, go into the project directory and run claude:
cd /path/to/your/project
claude
The first run prompts for login. Subscription or Console accounts just follow the prompt to complete authentication in the browser. If you have already set the ANTHROPIC_API_KEY environment variable (a way of placing a key in the system environment for programs to read) and agree when it asks whether to use this key, it skips the login prompt and uses the key directly. After a successful login the credentials are saved, so you do not need to log in again each time; to switch accounts or re-authenticate later, enter /login in a running session.
After entering a session, the version, current model, and working directory are shown above the prompt; enter /help to see available commands, and /resume to continue a previous conversation. Press Shift+Tab to switch the permission mode of the current session (which determines which operations ask you first).
6. Verify After Installing, Then Decide Whether to Update Manually
After installation, do not just check whether the install script reported an error; verify with two commands:
claude --version: prints the version number, showing the command can be found and can run.claude doctor: read-only diagnostics that do not start a session; it lists installation health, settings file validation errors, and warnings with suggestions.
The update strategy depends on the installation method. Native installations update automatically in the background, taking effect on the next launch after the download and installation completes; Homebrew, WinGet, and Linux package manager installations require manual updates by default, using brew upgrade claude-code (or brew upgrade claude-code@latest), winget upgrade Anthropic.ClaudeCode, and each package manager's own upgrade command, respectively. To update immediately without waiting for the next background check, run claude update.
The official documentation also has release channels: latest is the default channel and receives new features first; stable usually lags by about a week and skips versions with major regressions. You can switch in the Auto-update channel in /config, or write autoUpdatesChannel in settings.json; Homebrew installations distinguish channels by cask name and do not read this setting.
7. How to Confirm You Installed Official Files
Each official release provides a manifest.json (manifest file) that lists the SHA256 checksums of the binaries for each platform and is signed with Anthropic's GPG key (a signing mechanism used to verify a file's origin and integrity); verifying this signature is equivalent to verifying every binary it lists. macOS binaries are signed by "Anthropic PBC" and notarized by Apple, and Windows binaries are signed by "Anthropic, PBC"; Linux binaries are not individually code-signed — confirm integrity using the manifest signature or the package manager's repository signature.
8. If You Get Stuck, Troubleshoot in This Order
claudenot found: first confirm whether the installation directory has been added to PATH; the official documentation lists this case separately as "Fix your PATH".- Windows command error: first confirm whether you are in PowerShell or CMD; the commands for the two terminals cannot be mixed. If you see
The token '&&' is not a valid statement separator, you ran a CMD command in PowerShell; if you see'irm' is not recognized, you ran a PowerShell command in CMD. Switch to the matching terminal and run it again. - Install script error: for
syntax error near unexpected token '<', 403, or other errors, the official documentation recommends consulting "Troubleshoot installation" to find the corresponding fix and alternative installation methods. - Network issues: the system requirements state that an internet connection is required, and there are separate official network configuration instructions; troubleshoot according to those settings rather than trying to solve it by reinstalling repeatedly.
- Still runs after uninstalling: the official documentation explains this usually means there is a second installation, or a shell alias left by an old installer — find and remove it before reinstalling.
To uninstall a native installation, delete the executable file and the version directory (on macOS, Linux, and WSL use rm -f ~/.local/bin/claude and rm -rf ~/.local/share/claude; on Windows use the corresponding PowerShell delete commands); for Homebrew, WinGet, and npm installations, use brew uninstall --cask, winget uninstall, and npm uninstall -g respectively. Note: deleting ~/.claude also clears settings, allowed tools, MCP (configuration that lets external tools connect to Claude Code), and session history along with it. The official documentation advises uninstalling the desktop app, VS Code extension, and JetBrains plugin first, otherwise they will recreate this directory the next time they run.
If you are also comparing how to choose among ChatGPT subscription tiers, the site's ChatGPT subscription cost overview organizes the order of choice by use case, or you can look directly at the tier descriptions in ChatGPT top-up plans as another reference.