Home

Install Claude Code on Windows

Claude Code is an AI assistant that lives in your terminal and helps you write, debug, and understand code. This guide walks you through the complete setup: a quick native install via PowerShell, then WSL2 for the full Linux-powered experience.

Key Concepts

What You’ll Need

Note: The native Windows install has some limitations:

Continue with the steps below to install WSL2 for the full experience.

Step 2: Check Virtualization and Install WSL

First, check if virtualization is enabled:

If it says “Enabled”: Great! Continue below.

If it says “Disabled”: You need to enable virtualization in your computer’s BIOS settings:

Now install WSL:

Check if WSL and Ubuntu are already installed:

To install WSL and Ubuntu:

Note: If you get an error saying the command is not recognized, your Windows version might be too old. Make sure you have Windows 10 version 2004 or higher, or Windows 11.

Step 3: Set Up Ubuntu

After your computer restarts, a terminal window with “Ubuntu” in the title should open automatically within 2-5 minutes.

If the Ubuntu window did NOT open automatically:

Now complete the first-time setup:

Important: Remember this username and password — you’ll need them later.

Step 4: Install Claude Code in WSL

Step 5: Connect to Your Anthropic Account

Option A. Use your Claude Pro or Max subscription

Option B. Use Anthropic API key

If you have an Anthropic API key instead of a Claude subscription:

Option C. Use OpenRouter API (starts for free!)

OpenRouter is a unified API gateway that provides access to 500+ large language models through a single API key. This can be an economical way to use Claude Code, as you pay only for usage and can choose from models at various price points.

Notes:

Option D. Use Anthropic API via Azure Foundry

Before starting Claude Code, in the Ubuntu terminal, paste this code to define environment variables:

# Enable Microsoft Foundry integration
export CLAUDE_CODE_USE_FOUNDRY=1
# Azure resource name
export ANTHROPIC_FOUNDRY_RESOURCE=xxxx-eastus2
# Set models to your resource's deployment names
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
export ANTHROPIC_FOUNDRY_API_KEY=your_api_key

Note: Replace xxxx-eastus2 with your Foundry Resource name (do not use the entire base URL). Replace your_api_key with your complete API key from your Azure portal.

Then start Claude Code:

claude

You should now be able to use Claude Code with Azure-deployed Claude models.

Step 6: Test Claude Code

You’re all set! Type claude in the Ubuntu terminal and ask a general question such as “Explain quantum computing.”

Step 7: Access Your Projects

Native Windows (PowerShell):

WSL (Ubuntu):

Note: Claude operates inside a project folder. It saves settings in that folder. It’s Claude’s workspace.

Step 8: Update Claude Code

Claude Code updates automatically, but you can manually update at any time:

WSL (Ubuntu):

sudo claude update

Native Windows (PowerShell — run as administrator):

claude update

Next Steps

Troubleshooting

First step: Run Claude Doctor

If something isn’t working, try running this command first:

claude doctor

This built-in diagnostic tool checks your installation and reports common issues.

Claude command not found (native Windows)

“Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS”

This error means virtualization is not enabled:

“wsl –install” doesn’t work

Ubuntu window doesn’t open after restart

How to open Ubuntu terminal after closing it

Claude Code commands not found (WSL)

Need Help?


Created by Steven Ge on December 11, 2025. Updated February 2026.