What WSL Does and Why You'd Use It

Windows Subsystem for Linux (WSL) lets you run a Linux environment directly on Windows without a separate virtual machine or dual boot. You get a real Linux kernel running alongside Windows, which means you can install Linux tools, run Linux servers, and write Linux software — all from your Windows machine.

This is useful if you develop web applications, manage servers remotely, or need command-line tools that only exist on Linux. Instead of switching computers or booting into a different operating system, you open a terminal window and work in Linux. Your files stay accessible from Windows, and you can run both systems at the same time.

Key Takeaways

  • WSL requires Windows 10 version 2004 or later, or any version of Windows 11, and must be enabled through Settings or the command line.
  • WSL2 is the current version and uses a real Linux kernel, making it faster and more compatible than WSL1 for most server tasks.
  • You install a Linux distribution like Ubuntu from the Microsoft Store after enabling WSL, then use it like any other Linux system.
  • WSL can run web servers, databases, and development tools, but is not suitable for production servers that need to stay on 24/7 without a Windows restart.

Check Your Windows Version and System Requirements

WSL2 works on Windows 10 version 2004 and later, or any version of Windows 11. To check your version, press the Windows key, type "winver", and press Enter. Look for the "Version" number — if it shows 2004 or higher, you can proceed.

Your processor must support virtualization. Most modern CPUs do, but some older machines or corporate laptops may have it disabled in the BIOS. If you encounter errors during installation, you may need to restart your computer, enter the BIOS setup (usually by pressing Delete, F2, or F12 during startup), and enable virtualization or "Hyper-V" support.

You need administrator access to enable WSL. If you use a work computer, contact your IT department — they may have restrictions in place.

Enable WSL Through Settings or Command Line

The easiest method is through Settings. Press the Windows key, type "Turn Windows features on or off", and open that control panel. Scroll down, check the box next to "Windows Subsystem for Linux", and click OK. Windows will install the necessary files and ask you to restart.

Alternatively, open PowerShell as administrator (right-click the PowerShell icon and select "Run as administrator"), then type this command and press Enter:

wsl --install

This single command enables WSL, installs WSL2, and downloads Ubuntu automatically. When it finishes, restart your computer. After restart, Ubuntu will open and ask you to create a username and password — these are for your Linux environment, not your Windows account.

Install a Linux Distribution

If you used the PowerShell command above, Ubuntu is already installed. If you enabled WSL through Settings instead, you need to install a distribution manually.

Open the Microsoft Store, search for "Ubuntu" (or another distribution like Debian or Fedora), and click Install. The read is several hundred megabytes. Once installed, click Launch or search for "Ubuntu" in the Windows Start menu. The first launch takes a minute or two as it unpacks files. You will be asked to create a username and password for your Linux user account.

You can install multiple distributions if you want to test different Linux versions. Each runs independently, and you can switch between them using the command wsl --list in PowerShell to see what you have, or wsl -d DistributionName to open a specific one.

Set WSL2 as Your Default Version

WSL has two versions. WSL1 is older and slower; WSL2 uses a real Linux kernel and is much faster. If you installed WSL through the PowerShell command, WSL2 is already your default. If you enabled it through Settings, you may have WSL1 by default and should switch.

Open PowerShell as administrator and type:

wsl --set-default-version 2

This sets all future distributions to use WSL2. To check which version your current Ubuntu uses, type wsl --list --verbose in PowerShell. If it shows "1" under VERSION, convert it by typing wsl --set-version Ubuntu 2. The conversion takes a few minutes.

Run a Server and Access It From Windows

Once you have Ubuntu open, you can install and run servers just like on a real Linux machine. For example, to install and start a web server, type these commands one at a time:

sudo apt updatesudo apt install nginxsudo service nginx start

Nginx is now running inside WSL. To access it from Windows, open a web browser and go to localhost:80 or just localhost. You will see the Nginx welcome page.

Other common servers work the same way. Install Node.js with sudo apt install nodejs npm, Python with sudo apt install python3, or PostgreSQL with sudo apt install postgresql. Start them with their standard Linux commands, and access them from Windows using localhost and the port number.

Your Windows files are accessible from Linux at /mnt/c (for the C: drive), /mnt/d (for D:), and so on. Linux files are stored in a hidden folder that Windows can see but should not modify directly — use the Linux terminal to manage them.

Understand WSL's Limitations as a Server

WSL is excellent for development and testing, but not for production servers that need to run continuously. WSL stops when you shut down Windows or restart your computer. If you need a server that runs 24/7, you need a dedicated machine, a cloud provider like AWS or DigitalOcean, or a Raspberry Pi.

WSL also uses your Windows machine's resources — CPU, memory, and disk space. Running a large database or multiple services can slow down your Windows work. For serious server work, a separate machine is more reliable.

Networking is mostly transparent, but some advanced configurations (like exposing WSL services to other computers on your network) require extra setup. For straightforward localhost testing and development, WSL works without any special configuration.

Frequently Asked Questions

Can I access a WSL server from another computer on my network?

Not directly — WSL services are only visible to your Windows machine by default. To expose them to other computers, you need to set up port forwarding or use a tool like ngrok. For most development work, this is not necessary.

What if I get an error about virtualization being disabled?

Your processor has virtualization support, but it is turned off in the BIOS. Restart your computer and enter the BIOS setup (usually by pressing Delete, F2, or F12 during startup). Look for an option called "Virtualization", "VT-x", or "Hyper-V" and enable it. Save and exit. Then try the WSL installation again.

Can I run WSL and Docker at the same time?

Yes. Docker Desktop for Windows can use WSL2 as its backend, which is actually faster and more efficient than Docker's older method. When you install Docker Desktop, it will detect WSL2 and offer to use it automatically.

Do I need to pay for WSL?

No. WSL is free and included with Windows. The Linux distributions you install from the Microsoft Store are also free.

Will WSL slow down my Windows computer?

WSL uses resources only when it is running. If you close the Ubuntu window and do not start any WSL services, it has no impact on Windows performance. If you leave a server running, it will use some CPU and memory — the amount depends on what the server does.