Getting Claude Code up and running is straightforward, but there are several installation methods to choose from depending on your operating system and preferences. In this lesson, you'll install Claude Code, authenticate your account, and verify everything works correctly.
Learning Objectives
- Understand the prerequisites for running Claude Code
- Install Claude Code using the recommended method for your platform
- Authenticate with your Claude subscription or API key
- Run /doctor to verify your installation health
- Configure proxy settings for enterprise environments
- Update Claude Code when new versions are released
Prerequisites
Before installing Claude Code, you need one of the following:
- Claude.ai subscription: Pro ($20/month), Max ($40/month), Teams ($25-30/user/month), or Enterprise
- Anthropic Console account: Pay-as-you-go API access with credits
- Enterprise credentials: AWS Bedrock or Google Vertex AI access (for enterprise deployments)
You do NOT need Node.js or npm installed. The native installation includes everything Claude Code needs to run. The only exception is if you plan to work with JavaScript/TypeScript projects, in which case you'll want Node.js for those projects specifically, not for Claude Code itself.
Claude Code is a native application, not a Node.js package. It's designed to work across all programming languages and project types, from Python and Go to Java and Rust.
Installation Methods
There are three primary ways to install Claude Code. The native install method is recommended for most users because it includes automatic background updates.
The native installation script downloads the appropriate binary for your platform and sets up automatic updates. This is the official installation method recommended by Anthropic.
macOS, Linux, and WSL (Windows Subsystem for Linux):
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell (Run as Administrator):
irm https://claude.ai/install.ps1 | iexWindows Command Prompt (Run as Administrator):
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdThe installer will:
- Download the latest Claude Code binary for your platform
- Install it to the appropriate system location
- Add the
claudecommand to your PATH - Set up automatic background updates
- Create necessary configuration directories
After installation completes, close and reopen your terminal to ensure PATH changes take effect.
If you're already using Homebrew as your package manager, you can install Claude Code through brew:
brew install --cask claude-codeImportant limitation: Homebrew installations do NOT auto-update. You must manually update Claude Code periodically:
brew upgrade claude-codeCheck for updates weekly or when you notice new features announced in the Claude Code changelog.
Windows users can install via WinGet, the official Windows package manager:
winget install Anthropic.ClaudeCodeImportant limitation: WinGet installations do NOT auto-update. Update manually with:
winget upgrade Anthropic.ClaudeCodeFor automatic updates on Windows, use the native PowerShell or CMD installation method instead.
Verifying Installation
After installation, verify that Claude Code is in your PATH:
claude --versionYou should see output like:
Claude Code v1.2.3
If you get a "command not found" error, restart your terminal or manually add the installation directory to your PATH.
First Launch and Authentication
Navigate to any project directory and launch Claude Code:
cd ~/projects/my-app
claudeOn first launch, Claude Code will prompt you to authenticate. You'll see:
Welcome to Claude Code!
To get started, you need to authenticate.
Please visit: https://claude.ai/cli/auth?token=abc123xyz
Press Enter after completing authentication...
Open the authentication URL
Click the link or copy it into your browser. You'll be taken to claude.ai.
Sign in to your account
Log in with your Claude.ai credentials (email/password, Google, or SSO if your organization uses it).
Authorize Claude Code
Review the permissions and click "Authorize CLI Access". This grants the CLI permission to use your Claude subscription.
Return to terminal
Go back to your terminal and press Enter. Claude Code will verify authentication and start your first session.
Authentication tokens are stored securely in your system keychain (macOS), Credential Manager (Windows), or encrypted storage (Linux). You won't need to re-authenticate unless you explicitly log out or your token expires.
Authentication Options Explained
Claude Code supports multiple authentication methods depending on your account type and organizational setup.
Claude.ai Subscription
This is the most common method for individual users and small teams:
- Pro: $20/month, suitable for individual developers
- Max: $40/month, with access to Extended Thinking for complex tasks
- Teams: $25-30/user/month, with workspace collaboration features
- Enterprise: Custom pricing with advanced security, SSO, and deployment options
Simply log in through the browser flow as described above. Your subscription tier determines which models and features you can access through Claude Code.
Anthropic Console API Key
Developers using the Anthropic API directly can authenticate with an API key:
export ANTHROPIC_API_KEY=sk-ant-api03-...
claudeOr set it permanently in your shell configuration:
# Add to ~/.bashrc, ~/.zshrc, or equivalent
echo 'export ANTHROPIC_API_KEY=sk-ant-api03-...' >> ~/.bashrcAPI key authentication uses pay-as-you-go pricing based on token consumption. Monitor usage in the Anthropic Console at https://console.anthropic.com.
Enterprise Authentication
Organizations using AWS Bedrock or Google Vertex AI can configure Claude Code to route requests through their enterprise infrastructure:
# AWS Bedrock
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
claude --provider bedrock
# Google Vertex AI
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
export GOOGLE_CLOUD_PROJECT=my-project-id
claude --provider vertexConsult your organization's AI platform administrator for specific configuration details.
Running the Health Check with /doctor
After authenticating, run the /doctor command to verify everything is working correctly:
claudeThen in the Claude Code session:
/doctor
The health check will verify:
- Installation integrity: Binary version and checksum
- Authentication status: Active session and token validity
- Network connectivity: Ability to reach Anthropic's API servers
- Model access: Which Claude models you can use (Opus, Sonnet, Haiku)
- Tool availability: Whether file operations, shell access, and other tools are enabled
- Configuration: Environment variables and settings
Example output:
Running health check...
✓ Claude Code v1.2.3 installed correctly
✓ Authenticated as user@example.com (Claude Pro)
✓ Network connectivity: OK (latency: 45ms)
✓ Available models: claude-opus-4-6, claude-sonnet-4-5
✓ File system tools: Enabled
✓ Shell execution: Enabled
✓ Web search: Enabled
Everything looks good! Claude Code is ready to use.
If /doctor reports issues, check your internet connection, verify your subscription is active, and ensure no firewall or proxy is blocking api.anthropic.com. Enterprise users should confirm their VPN and proxy settings.
Proxy and Enterprise Network Configuration
If you're behind a corporate firewall or proxy, configure these environment variables before launching Claude Code:
# HTTP/HTTPS proxy
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
# Bypass proxy for specific domains
export NO_PROXY=localhost,127.0.0.1,.company.com
# Launch Claude Code
claudeFor persistent configuration, add these to your shell profile:
# Add to ~/.bashrc or ~/.zshrc
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080Some enterprise environments require SSL certificate validation configuration:
# Use custom CA certificate bundle
export SSL_CERT_FILE=/path/to/company-ca-bundle.crt
claudeEnterprise administrators: If you're deploying Claude Code across multiple workstations, consider creating a shared configuration script that sets these variables automatically when users launch Claude Code.
Updating Claude Code
Keeping Claude Code up to date ensures you have the latest features, bug fixes, and security patches.
Native installation (auto-updates):
Claude Code checks for updates automatically in the background and installs them. You can manually trigger an update:
claude updateHomebrew:
brew upgrade claude-codeWinGet:
winget upgrade Anthropic.ClaudeCodeAfter updating, restart any active Claude Code sessions to use the new version. Check the changelog at https://claude.ai/code/changelog to see what's new.
| Method | Auto-updates | Update Command | Best For |
|---|---|---|---|
| Native install | Yes | claude update | Most users |
| Homebrew | No | brew upgrade claude-code | macOS devs using brew |
| WinGet | No | winget upgrade Anthropic.ClaudeCode | Windows users |
Claude Code Beyond the CLI
While this course focuses on the command-line interface, Claude Code is available in multiple environments:
- VS Code extension: Install from the VS Code marketplace for in-editor AI assistance
- JetBrains plugin: Available for IntelliJ, PyCharm, WebStorm, and other JetBrains IDEs
- Desktop app: Standalone application for macOS, Windows, and Linux
- Web interface: Access Claude Code directly at https://claude.ai/code
All interfaces share the same underlying Claude models and capabilities. The CLI is particularly powerful for automation, SSH workflows, and developers who prefer terminal-based environments.
Troubleshooting Common Installation Issues
"Command not found" after installation:
The claude command isn't in your PATH. Restart your terminal or manually add the installation directory:
# macOS/Linux
export PATH="$HOME/.claude/bin:$PATH"
# Windows (PowerShell)
$env:Path += ";$env:LOCALAPPDATA\Claude\bin"Authentication fails repeatedly:
Clear cached credentials and re-authenticate:
claude logout
claudeNetwork timeouts or connection errors:
Verify you can reach Anthropic's servers:
curl -I https://api.anthropic.comIf this fails, check firewall rules, proxy settings, or VPN configuration.
Permission denied on Linux/macOS:
Ensure the installation script ran with appropriate permissions:
sudo curl -fsSL https://claude.ai/install.sh | sudo bashInstall and Verify Claude Code
beginner15 minComplete these hands-on steps to solidify your understanding:
- Install Claude Code using the recommended native installation method for your platform
- Authenticate by running
claudeand completing the browser authentication flow - Run /doctor and verify all checks pass
- Start a session in an existing project directory (or create a new empty directory)
- Ask Claude to explain the project structure or, if it's empty, to suggest a starter project idea
- Check the version with
claude --versionand confirm you're on the latest release - Set up automatic updates (if using Homebrew or WinGet, create a calendar reminder to update monthly)
Take a screenshot of your /doctor output for your records. This baseline helps troubleshoot issues later if something stops working.
Key Takeaway
Installation is a one-time setup that takes less than five minutes. The native install method provides automatic updates and is the recommended approach for most users. Once authenticated, Claude Code remains ready to use across all your projects. Run /doctor periodically to ensure everything stays healthy, especially after system updates or network configuration changes.
Next Steps
With Claude Code installed and authenticated, you're ready to learn the core interface. In the next lesson, we'll explore how to navigate the CLI, understand the conversation flow, use slash commands, and manage your development sessions effectively.