Blog
3 min read

What Is WSL? Running Linux on Windows, Explained

WSL lets you run a real Linux system inside Windows without dual-booting or a separate virtual machine to manage. What it is, why web developers use it, how to install it, where your files live, and the performance and networking gotchas.

WSL — Windows Subsystem for Linux — lets you run Linux on a Windows computer, side by side with your normal Windows apps. You open a terminal, and you're in Ubuntu (or another Linux distribution), with real Linux commands and tools. No dual-booting, no separate virtual machine to set up.

Why it exists

Most of the web runs on Linux. Servers, Docker, deployment scripts, and most tutorials assume Linux or macOS commands. On Windows, that used to mean a constant stream of small incompatibilities: different paths, different shell syntax, tools that don't install.

WSL gives you a real Linux environment, so you develop the same way your app will run in production. (What is Linux?)

WSL 1 vs WSL 2

  • WSL 2 (the default) runs a real Linux kernel in a lightweight virtual machine that Windows manages for you. Full compatibility — Docker, systemd and most tools work.
  • WSL 1 translated Linux calls into Windows ones. Faster for accessing Windows files, but less compatible.

Use WSL 2 unless you have a specific reason not to.

Installing it

Open PowerShell as administrator and run:

wsl --install

Restart when asked. This installs WSL 2 and Ubuntu. Then open Ubuntu from the Start menu (or a tab in Windows Terminal), choose a Linux username and password, and you're in.

sudo apt update && sudo apt upgrade

Other distributions are available: wsl --list --online.

Where your files live

There are two file systems, and this is the most important thing to understand:

  • Linux files: /home/yourname/... inside WSL. From Windows, find them in File Explorer under Linux or at \\wsl$\Ubuntu\home\yourname.
  • Windows files: your C: drive appears inside Linux at /mnt/c/.

Keep your projects in the Linux file system (~/projects/my-app), not under /mnt/c/.... Working across the boundary is much slower — npm install can take several times longer — and file watchers (hot reload) often miss changes.

Using it with your tools

  • VS Code: install the WSL extension. From the Ubuntu terminal, run code . in your project; VS Code opens on Windows but runs its tools inside Linux. (VS Code for beginners)
  • Docker Desktop can use WSL 2 as its engine, and your containers are available inside WSL.
  • Git, Node, Python — install them inside WSL for Linux projects. They're separate from any Windows installs.
  • AI coding agents like Claude Code install inside WSL with the Linux installer. (Claude Code on Windows)

Networking

Servers you start inside WSL (like npm run dev on port 3000) are reachable from Windows browsers at localhost:3000 in typical setups. If not, check WSL's networking mode settings in .wslconfig. (What is localhost?)

Common gotchas

  • Two of everything. Node in Windows and Node in WSL are separate installs with separate packages. Pick one per project.
  • Line endings. Windows tools may save files with CRLF endings, which can break shell scripts in Linux. Configure your editor and git to use LF.
  • Memory. WSL 2 can use a lot of RAM; limit it in %UserProfile%\.wslconfig if needed.
  • Clock drift after sleep can cause odd SSL or git errors; restarting WSL (wsl --shutdown) fixes it.

Useful commands (from PowerShell)

wsl                    # open the default distribution
wsl --list --verbose   # list installed distributions and versions
wsl --shutdown         # stop WSL completely (fixes many oddities)
wsl --update           # update WSL itself

The summary

  • WSL runs real Linux inside Windows; WSL 2 is the default and the one to use.
  • Install with wsl --install.
  • Keep projects in the Linux file system, not /mnt/c.
  • Use VS Code's WSL extension and install dev tools inside Linux.

Prefer not to manage Linux on your laptop at all? EasySpawn gives you a persistent Linux server with Claude Code ready, reachable from a browser on any Windows machine. See how it works or join the waitlist.

Related: Claude Code on Windows · What Is Linux? · The Terminal for Complete Beginners · What Is Docker?

Keep reading