# Run Claude Code on Windows with WSL

> Enable WSL with wsl --install, run the Linux installer for Claude Code inside Ubuntu, fix the PATH, and keep projects on the Linux filesystem.

- Canonical: https://guides-ai.com/guides/claude-code-wsl-windows/
- Plate 01.06 · Topic: Install & set up (https://guides-ai.com/topics/setup/)
- Published: 19 Oct 2026 · 3 min read
- Source site: guides-ai — https://guides-ai.com/

Searching "ubuntu claude command not found" usually means you installed Claude Code inside WSL and
the shell cannot see it yet. Claude Code's native installer targets macOS, Linux, and WSL, so on
Windows the Linux build runs under WSL. Native Windows is supported too; WSL 2 is the one Windows
route that also gets [sandboxing](https://code.claude.com/docs/en/sandboxing).

## 1. Decide: WSL or native Windows

Both are supported on Anthropic's [setup page](https://code.claude.com/docs/en/setup). Pick WSL 2
for Linux toolchains or sandboxed command execution; pick native Windows if your projects and tools
are Windows-native. For the native route, use
[Install Claude Code on Windows](/guides/install-claude-code-windows/) instead. WSL 1 runs Claude
Code but has no sandboxing.

## 2. Install WSL and Ubuntu

```powershell
wsl --install
```

Run this in an Administrator PowerShell, then restart: it enables WSL and installs Ubuntu on WSL 2
by default.

```powershell
wsl --list --online
```

Lists other distributions; install a specific one with `wsl --install -d <Distro>`.

## 3. Run the Linux installer inside Ubuntu

Open the Ubuntu app from the Start menu, not PowerShell or CMD, then run the Linux installer:

```bash
curl -fsSL https://claude.ai/install.sh | bash
```

Downloads and installs the `claude` launcher to `~/.local/bin/claude` inside WSL.

```bash
claude --version
```

Prints a version such as `2.1.211 (Claude Code)` once the install directory is on your PATH.

## 4. Fix the PATH if claude is missing

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
```

Adds the install directory to your PATH for good, the usual cure for "command not found" right
after installing. More fixes: [claude: command not found](/guides/fix-claude-command-not-found/).

## 5. Open a project the fast way

```bash
cd ~/projects/my-app && claude
```

Starts a session scoped to that folder; keep the project in your Linux home (`~/`), not under
`/mnt/c/`.

Reading the Windows filesystem across from WSL is slow, and Anthropic's troubleshooting page warns
that search returns fewer results on `/mnt/c/`. Clone into `/home/` for full-speed file reads, then
begin [your first session](/guides/first-claude-code-session/).

## Verify it worked

Run `claude doctor` in Ubuntu for read-only install diagnostics. If it reports no errors and
`claude --version` prints a number, WSL is ready.

**If it fails:**

- **`wsl --install` prints the WSL help text instead of installing** — WSL is already present. Run
  `wsl --list --online`, then `wsl --install -d Ubuntu`.
- **`claude: command not found` in Ubuntu** — the install directory is not on your PATH yet; run the
  `export PATH` line in step 4 and reopen the shell.
- **Search misses files or feels slow** — the project sits on `/mnt/c/`; move it to `/home/` on the
  Linux filesystem.
