No history yet

Install and Authenticate

Getting Set Up

Before you can start using Claude Code, your computer needs two essential tools: Node.js and Git. Claude Code requires Node.js version 18 or newer to run its environment. Git is necessary for version control, especially if you plan to connect with repositories on platforms like GitHub.

Once the prerequisites are installed, you can install the Claude Code command-line interface (CLI) with a single command. Open your terminal (on macOS or Linux) or PowerShell (on Windows) and run the appropriate command below.

# For macOS or Linux
curl -o- https://raw.githubusercontent.com/anthropics/claude-code-cli/main/install.sh | bash

# For Windows (using PowerShell)
irm https://raw.githubusercontent.com/anthropics/claude-code-cli/main/install.ps1 | iex

First Launch and Login

With the installation complete, the next step is to authenticate your account. The first time you run the claude command in your terminal, it will automatically open a new tab in your web browser, prompting you to log in to your Anthropic account. This links the CLI to your subscription.

Lesson image

If you have a Claude Pro or Teams plan, you'll log in with your standard credentials. The browser will handle the authentication and then you can return to your terminal. It’s a straightforward process designed to get you running quickly.

API Keys and Other Methods

Alternatively, if you're using Claude through a developer Console account, you can authenticate using an . This method doesn't require the browser-based login. Instead, you set an named ANTHROPIC_API_KEY to the value of your secret key.

Setting an environment variable is a common and secure way to handle credentials for command-line tools, as it keeps your secret keys out of your command history.

# On macOS or Linux (add to your .zshrc or .bashrc)
export ANTHROPIC_API_KEY='your_api_key_here'

# On Windows (PowerShell)
$Env:ANTHROPIC_API_KEY = 'your_api_key_here'

Verifying Your Installation

Regardless of how you authenticated, you can confirm that Claude Code is installed and ready to go by checking its version. Run the following command in your terminal. If it returns a version number, your setup is complete.

claude --version

Now that you're set up, let's test your knowledge.

Quiz Questions 1/4

What are the two essential prerequisites for installing Claude Code?

Quiz Questions 2/4

True or False: For a Claude Pro user, the first time you run the claude command, it will automatically open a browser window for authentication.

You are now ready to start using Claude Code to automate tasks and streamline your workflows.