> ## Content Index
> Fetch the complete content index at: https://www.winsolvetech.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Claude Code WSL Setup on Windows
- URL: https://www.winsolvetech.com/claude-code-wsl-setup-windows/
- Published: 2026-10-07T17:33:38.000Z
- Updated: 2026-10-07T17:33:38.000Z
- Author: MD Syful Islam Rasel
- Tags: Windows 11, Troubleshooting

If you want Claude [Code on a Windows](https://www.winsolvetech.com/windows-11-automatic-updates/) machine without wrestling with Windows-specific setup issues, install and run it inside WSL 2, not in PowerShell or Command Prompt. That gives you a Linux shell, Linux file paths, and the environment Claude Code expects. To get there, install WSL first, open a Linux distro such as Ubuntu, install Node and Git inside that distro, and then install Claude Code from the Linux shell.

## What you need before you start

- A Windows 11 PC, or a recent Windows 10 build that supports WSL 2.
- Administrator access for the initial WSL install.
- A Linux distro installed through WSL, usually Ubuntu.
- A working terminal app on Windows, such as Windows Terminal or PowerShell.
- An internet connection for installing Windows features, the distro, Node, and Claude Code.
- A Git repo or a project folder you can use as your first test.

If WSL is already installed but you are not sure which version you have, check before installing anything else. Claude Code should run inside the Linux environment, [not from the Windows](https://www.winsolvetech.com/create-bootable-usb-windows-11/) side. That avoids a lot of path and permission problems later.

![A Windows laptop is open to an Ubuntu terminal for setup.](https://tse1.mm.bing.net/th?q=Windows%20laptop%20with%20Ubuntu%20terminal&w=624&h=352&c=7)

## Install WSL the right way

The safest fast path is to install WSL from an elevated PowerShell window and let Microsoft set up the pieces for you.

1. Open PowerShell as Administrator.
2. Run the WSL install command.

```powershell
wsl --install
```

PowerShell (run as Administrator)

1. If you want Ubuntu specifically, install it after WSL finishes, or use the distro name in the install flow if your Windows version shows that option.
2. Reboot if Windows asks you to.
3. Open the distro from the Start menu after the install completes.

By default, modern WSL installs use WSL 2 for new distros. If your system already had WSL, or if you want to make sure future distros use version 2, set the default explicitly.

```powershell
wsl --set-default-version 2
```

PowerShell

If Windows says the WSL feature or Virtual Machine Platform is missing, install those Windows components first and then rerun `wsl --install`. The goal is to finish with a real WSL 2 distro, not a half-installed shell.

## Open your Linux shell and check that it really is WSL 2

Open the distro from the Start menu, or from Windows Terminal if you have it set up. You should land in a Linux shell, not a Windows prompt.

Then check the installed WSL distros and versions from Windows.

```powershell
wsl -l -v
```

PowerShell

You want your distro to show `VERSION` as `2`. If it shows `1`, convert it.

```powershell
wsl --set-version Ubuntu 2
```

PowerShell

Replace `Ubuntu` with your actual distro name if needed.

If you only have one distro and it already says `2`, you can move on. This check matters because Claude Code is much less awkward in WSL 2 than in WSL 1, especially once you start working with files, Git, and editor integration.

## Install the tools Claude Code depends on

Install the Linux-side tools inside the WSL shell, not in Windows. That means running package commands in Ubuntu or your chosen distro.

1. Update the package lists.

```bash
sudo apt update
```

Linux shell

1. Install Git, curl, and a few common helper packages.

```bash
sudo apt install -y git curl ca-certificates
```

Linux shell

1. Install Node.js in the Linux environment. The exact version Claude Code expects can change, so check the current requirement in the Claude Code docs if you have it. If you do not, use a current LTS Node release in WSL rather than the Windows Node installer.
2. Verify Node and npm are available in WSL.

```bash
node -v
npm -v
```

Linux shell

If either command fails, install Node properly inside WSL before going further. A working `node` in WSL is the difference between a smooth install and a confusing PATH chase.

If `node` is missing but you already installed it on Windows, that does not count here. WSL needs its own Linux Node binary. If `npm` installs global packages somewhere unexpected, you may need to fix the Linux `PATH` after you install Claude Code.

## Install Claude Code in WSL

Run the install from inside the Linux shell so the package lands in the Linux environment.

1. Open your WSL distro.
2. Install Claude Code using the install command provided by the Claude Code docs for Linux. If the current installer is the common npm-based route, it will look like a Linux shell command, not a Windows installer.

```bash
npm install -g @anthropic-ai/claude-code
```

Linux shell

1. If the install completes but the `claude` command is not found, check where global npm binaries are going.

```bash
npm bin -g
```

Linux shell

1. Make sure that directory is on your Linux `PATH`. If it is not, add it to your shell profile, then reopen the shell.
2. If the install still fails with permission errors, do not switch to the Windows side to work around it. Fix the Linux install path or use the user-level shell environment the installer expects.

The main rule is simple: do not install Claude Code from PowerShell and expect it to behave like a WSL tool. If the install happens on the Windows side, you usually end up with mismatched paths, a Windows Node runtime, or a command that works in one shell and not the other.

## Sign in and start your first project

Once the install is done, authenticate from the WSL shell and point Claude Code at a real project folder.

1. Change into your project directory inside WSL.

```bash
cd ~/projects/your-repo
```

Linux shell

1. Start Claude Code from that folder.

```bash
claude
```

Linux shell

1. Follow the sign-in flow it gives you.
2. Run a small, safe first task in the repo, such as asking it to inspect files or explain the project structure.

If you have not moved a project into the Linux filesystem yet, you can still start from a Windows-mounted path, but that is not the best long-term setup. A repo stored under your WSL home directory or another Linux path usually behaves better than one living under `/mnt/c/`.

The goal here is not just to launch the app. It is to confirm that Claude Code can read your project, start cleanly, and respond from the same Linux environment where you installed it.

## Fix the common Windows and WSL mistakes

Most setup problems come from mixing the Windows side and the Linux side.

If you installed Claude Code in PowerShell by mistake, uninstall that copy and reinstall it from the WSL shell. A Windows install can leave you with a command that resolves in PowerShell but not in Ubuntu.

If `claude` is not found, check the Linux PATH first, not the Windows PATH. In WSL, your shell profile files and Linux package paths matter more than Windows environment variables.

If Node is present in Windows but missing in WSL, install Node again inside the distro. The two environments do not automatically share executables.

If you get permission errors, check whether you are trying to write under a Windows-mounted folder with odd ownership rules. Moving the repo into the Linux filesystem often clears that up.

If the install script complains about unsupported Node versions, replace the WSL Node version with one that matches Claude Code’s current requirements. Do not try to make Windows Node carry the Linux install.

If a package command asks for `sudo`, use it for system packages only. Keep Claude Code itself and your project files in your user space unless the install docs tell you otherwise.

## Use files, editors, and Git without tripping over path issues

The easiest WSL habit is to keep active repos in the Linux filesystem when you can. For example, `~/projects/my-app` is usually smoother than `/mnt/c/Users/you/Desktop/my-app`.

That matters because file permissions, line endings, and file watchers tend to behave more predictably on the Linux side. Windows-mounted folders work, but they can feel slower or more fragile for some workflows.

For VS Code, open the folder through Remote - WSL so the editor attaches to the Linux environment instead of opening the Windows copy of the project. That way the terminal, Git, and Claude Code all agree on the same paths.

If VS Code behaves differently in WSL, check that you opened the folder through Remote - WSL and not as a normal Windows folder. If a Windows tool needs a file path, remember that `C:\` paths and `/mnt/c/` paths are not interchangeable. If you need to reach a Windows file from WSL, use the mounted path under `/mnt/c/`.

For Git, keep using Git inside WSL once the repo lives there. A repo managed from both Windows Git and WSL Git at the same time can create avoidable noise.

## Confirm everything is working

You know the setup is good when these checks all pass:

- `wsl -l -v` shows your distro running as version 2.
- `node -v` and `npm -v` work inside the Linux shell.
- `claude` starts from inside the WSL distro.
- Claude Code can see the files in your chosen repo.
- You can save edits without permission errors.
- VS Code opens the project through Remote - WSL and uses the same folder path.

A practical final test is to open one real repo, start Claude Code there, and ask it to inspect or summarize the project. If it can read the repo and respond without path errors, the setup is doing what you want.

## When to reinstall or start over

Sometimes a fresh install is faster than untangling a broken one.

Start over if the distro is stuck on WSL 1 and conversion keeps failing, if Node was installed in the wrong place and PATH changes have become messy, or if you have mixed Windows and WSL installs enough that you are not sure which `claude` command you are actually running.

A clean reinstall is also reasonable if the distro itself is damaged or you have several half-working package installs that keep colliding. In that case, export anything you need, remove the broken distro, reinstall WSL 2, and set up Ubuntu again from scratch.

If you do wipe it, keep one rule in mind: install the tools in WSL, keep the repo path clear, and verify each layer before moving to the next. That keeps the next setup short.

## Conclusion

Once Claude Code starts cleanly inside WSL 2, the rest of the workflow gets much easier. Keep the project in the Linux filesystem when you can, use VS Code through Remote - WSL, and treat Windows tools as helpers rather than the main runtime. If anything breaks later, check the distro version, Node inside WSL, and the path you opened before changing more than one thing at a time.

## Frequently Asked Questions

### Can I install Claude Code from PowerShell and use it in WSL?

You can, but that usually creates path and runtime confusion. Install it from inside the WSL shell so it lives with your Linux Node setup.

### Do I need Ubuntu specifically?

No. Any supported WSL Linux distro can work, but Ubuntu is the most common starting point and the easiest to follow for most Windows users.

### Why does Claude Code work better in WSL 2 than WSL 1?

WSL 2 gives you a real Linux kernel environment, which usually behaves better with Node, Git, file paths, and editor integration.