How To Enable WSL and Use It as a Server on Windows

Running Linux on Windows with WSL (Windows Subsystem for Linux) is handy for development, testing, and even hosting small services. Many people want to enable WSL and use it like a server: hosting web apps, APIs, databases, or internal tools, all from a Windows machine.

This guide walks through how that works, what to expect, and the main variables that shape your own setup.

What Is WSL and How Can It Act as a Server?

WSL is a feature in Windows that lets you run a Linux environment without a virtual machine or separate hardware. You can install Linux distributions like Ubuntu, Debian, or Fedora directly from the Microsoft Store and run them alongside your Windows apps.

When you “use WSL as a server,” you’re typically doing things like:

  • Running a web server (Nginx, Apache, Caddy)
  • Hosting application servers (Node.js, Python/Flask/Django, Ruby, PHP-FPM, .NET on Linux)
  • Running databases (PostgreSQL, MySQL/MariaDB, Redis for development)
  • Providing local network services (internal APIs, test environments)

In WSL, these services run inside the Linux environment, but they can often be reached:

  • From Windows itself (localhost access)
  • From other devices on your local network (with some networking configuration)
  • Through port forwarding or reverse proxies from the internet (if you set that up securely)

WSL behaves a bit like a lightweight VM, but with tight Windows integration, which affects how you enable it and how networking works.

Step-by-Step: How To Enable WSL on Windows

The exact steps differ slightly between Windows 10 and Windows 11, and between WSL 1 and WSL 2. For most people today, WSL 2 is the better choice because it gives you:

  • A real Linux kernel
  • Better compatibility
  • More “Linux-like” networking and file system behavior

1. Check Your Windows Version

WSL works best on Windows 10 (newer builds) and Windows 11.

You can check your version:

  1. Press Win + R
  2. Type winver and press Enter
  3. Note the edition and build number

Newer versions have the wsl --install command, which simplifies everything.

2. Enable WSL Using PowerShell

Open PowerShell as Administrator:

  • Press Start, search for PowerShell
  • Right-click Windows PowerShell (or Windows Terminal) → Run as administrator

Then run: