WSL + Docker Setup on Windows
A step-by-step guide to set up WSL2 (Windows Subsystem for Linux) and Docker Desktop for development on Windows 10/11.
Prerequisites
| Requirement | Description |
|---|---|
| Windows Edition | Windows 10/11 (64-bit) Home or Pro |
| Virtualization | Must be enabled in BIOS |
| Internet Connection | Required to download WSL and Docker |
Step 1: Enable WSL & Virtualization
Search "Turn Windows features on or off" and enable:
- Windows Subsystem for Linux
- Virtual Machine Platform
Restart your computer after enabling features.
Step 2: Install WSL2 with Ubuntu
Open PowerShell as Administrator and run:
powershell
wsl --installThis will:
- Install WSL
- Set WSL2 as default
- Install Ubuntu (or the default distro)
You may need to restart once it finishes.
To verify:
powershell
wsl --list --verboseStep 3: Install Docker Desktop
- Download Docker: https://www.docker.com/products/docker-desktop
- Run
Docker Desktop Installer.exe - During setup:
- Enable WSL2-based engine
- Use recommended settings
Docker will install and set up integration with WSL automatically.
Step 4: Restart and Launch Docker
- Reboot your PC.
- Launch Docker Desktop.
- Wait until you see the 🟢 "Docker is running" message.
Step 5: Verify Everything Works
Open Ubuntu (WSL) or PowerShell and run:
bash
docker version
docker run hello-worldYou should see a welcome message from Docker if it's working correctly.
Optional: Enable WSL Integration in Docker
- Open Docker Desktop → ⚙️ Settings
- Go to Resources → WSL Integration
- Enable integration for your desired distro (e.g., Ubuntu)
Recommended Dev Directory
For best performance, store your code inside the Linux filesystem:
bash
cd ~
mkdir dev
cd devAvoid using C:\Users\... paths for heavy development workloads in WSL.
Uninstall (If Needed)
- Uninstall Docker Desktop from Control Panel
- Run:powershell
wsl --unregister <distro-name> - Delete related folders:
~/.docker, etc.
Tips
- Use Docker Compose (preinstalled) to manage multi-container apps.
- WSL2 allows full Linux support without dual-booting.
- Use
wsl --updateoccasionally to get latest WSL improvements.
Happy Docking! 🚀