Introduction

Install WSL on Windows

Windows Subsystem for Linux (WSL) lets you run a full Linux terminal on Windows — no virtual machine, no dual-boot required. It's the recommended way to set up a web development environment on Windows.


What is WSL?

WSL is a feature built into Windows that runs a real Linux kernel alongside Windows. As a web developer, this matters because:

  • Most web servers, cloud platforms, and dev tools are built for Linux
  • You get access to bash, native package managers (apt), and Unix file paths
  • Node.js, Python, Git, and databases all behave the same as on a Mac or Linux machine

WSL 2 (the current version) uses a full Linux kernel and is significantly faster than the original WSL 1.

Windows version required

WSL 2 requires Windows 10 version 2004 (Build 19041) or higher, or Windows 11. To check your version, press Win + R, type winver, and press Enter.


Step 1 — Enable WSL

Open PowerShell as Administrator (right-click the Start menu → "Windows PowerShell (Admin)" or "Terminal (Admin)") and run:

wsl --install

This single command does everything:

  1. Enables the WSL feature
  2. Enables the Virtual Machine Platform feature
  3. Downloads and installs the Linux kernel
  4. Sets WSL 2 as the default version
  5. Installs Ubuntu as the default Linux distribution

Restart your computer when prompted.

Already have WSL installed?

If WSL is already installed but you want to upgrade to WSL 2, run wsl --set-default-version 2 and then wsl --update.


Step 2 — Set up your Linux username and password

After your computer restarts, Ubuntu will launch automatically and ask you to create a Linux account:

Enter new UNIX username: john
New password:
Retype new password:
passwd: password updated successfully
  • The username does not have to match your Windows username
  • The password won't show any characters as you type — that's normal
  • Remember this password; you'll need it whenever you run sudo

Step 3 — Update your packages

Once you're inside the Ubuntu terminal, update the package list and upgrade any outdated packages:

sudo apt update && sudo apt upgrade -y

This makes sure your Linux environment starts fresh with the latest software.


Windows Terminal gives you a much better experience than the default console — tabs, themes, and proper font rendering.

Install it from the Microsoft Store or run:

winget install Microsoft.WindowsTerminal

Once installed, open Windows Terminal and select Ubuntu from the dropdown to launch your WSL shell.


Useful WSL commands

Run these in PowerShell or Command Prompt (not inside WSL):

wsl --list --verbose       # list installed distributions and WSL version
wsl --set-default Ubuntu   # set Ubuntu as the default distribution
wsl --shutdown             # stop all running WSL instances
wsl --update               # update the WSL kernel

Accessing your files

From WSL → Windows files

Your Windows drives are mounted under /mnt/:

ls /mnt/c/Users/YourName/Desktop

From Windows → WSL files

In Windows Explorer, type \\wsl$ in the address bar. You'll see your Linux distributions listed as network folders.

Keep your project files inside WSL

For the best performance, store your code inside the WSL filesystem (e.g. ~/projects/) rather than on your Windows drive. File I/O across the boundary is significantly slower.


Next steps

With WSL installed you now have a proper Linux development environment on Windows. Continue with Setup your environment to install Node.js, Git, and your code editor inside WSL.

Previous
Getting started