Claude CodeBeginner

How to Install Claude Code on Windows with WSL

Set up Windows Subsystem for Linux, install Claude Code inside it, and run the CLI from a real Linux shell on Windows.

9 minBeginner

Claude Code runs best on a Unix-like shell, so on Windows the recommended path is the Windows Subsystem for Linux (WSL). This gives you a real Ubuntu environment where the CLI, git, and your build tools all behave the way the agent expects. This guide installs WSL, then Claude Code inside it.

What you need

  • Windows 10 version 2004+ or Windows 11
  • Administrator rights to enable WSL
  • An Anthropic account or API key
  • About 15 minutes including a reboot

Step 1: Install WSL

Open PowerShell as Administrator and run the single install command. It enables the feature, installs Ubuntu, and sets WSL 2 as the default. Reboot when prompted.

PowerShell (Admin)
wsl --install
PowerShell - wsl --install
PS C:\> wsl --install
Installing: Virtual Machine Platform
Installing: Windows Subsystem for Linux
Installing: Ubuntu
The requested operation is successful. Restart to finish.
WSL pulls down the Ubuntu image and asks you to restart.

Step 2: Create your Linux user

After the reboot, launch Ubuntu from the Start menu. The first run asks you to pick a username and password for the Linux account. This is separate from your Windows login.

Step 3: Install Node inside WSL

Inside the Ubuntu shell, install Node with nvm so you control the version without touching system packages.

Ubuntu (WSL) - node
$curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
$source ~/.bashrc
$nvm install --lts
Now using node v20.x.x
$

Step 4: Install and launch Claude Code

With Node in place, install the CLI globally and start it. The first launch opens your default browser for sign-in.

Ubuntu (WSL)
npm install -g @anthropic-ai/claude-code
claude --version
claude
Ubuntu (WSL) - first run
user@DESKTOP:~$ claude
Welcome to Claude Code
Authenticated. Type your first request.
>
Claude Code running inside the Linux shell on Windows.
Keep your code inside WSL
Work on files under the Linux home (for example /home/you/projects), not under /mnt/c. Cross-filesystem access is slow and breaks file watching, which makes the agent feel sluggish.

Result: you have a genuine Linux toolchain on Windows with Claude Code installed. From here, every other guide in this series works the same as it does on macOS or Linux.

Watch related tutorials

Tags
#install#windows#wsl#setup#cli