At first, using Docker on Windows meant problems. Poor performance, volumes that wouldn’t sync, and a pretty miserable user experience compared to Linux or Mac.
But that changed a long time ago. Since WSL2 (Windows Subsystem for Linux 2) arrived, we can now run Docker on Windows with native performance (almost), perfect integration, and consuming much fewer resources.
Look… don’t expect perfection either. It still works better on Linux, it’s its natural habitat. But now it’s almost, almost the same.
In this article, we are going to see the correct way to install Docker on Windows using WSL2, step by step 👇
Why WSL2 and not Hyper-V?
In the past, Docker Desktop for Windows would create a heavy virtual machine in Hyper-V.
Now, with WSL2, Windows integrates a real Linux Kernel within the operating system itself.
- Instant startup: Instead of minutes, it takes seconds.
- Dynamic resources: If Docker isn’t doing anything, it doesn’t consume RAM. Previously it would reserve a fixed 2GB or 4GB even when idle.
- File integration: You can access Linux files from Windows Explorer and vice versa.
Install Docker Desktop
If you already had WSL installed before, make sure it’s updated by running
wsl —update
Now that we have the foundation (WSL2), let’s install the tool.
Go to the official website and download Docker Desktop for Windows.
Run the installer.
During installation, you will see a checkbox that says:
☑ Use WSL 2 instead of Hyper-V (recommended)
Make sure it is CHECKED. Once installed, sign out of Windows or restart if prompted.
To follow this guide you need Windows 10 (version 2004 or higher) or Windows 11. If you have an older version, I highly recommend updating.
Configuration and first startup
Open “Docker Desktop” from the start menu. The first time, it will ask you to accept the terms.
Afterwards, you will see the whale icon in the taskbar (near the clock). Wait for the icon to stop “moving” and turn solid green or white.
To verify everything is using the correct architecture:
Open Docker Desktop.
Go to the gear icon (Settings) ⚙️.
Under General, make sure “Use the WSL 2 based engine” is checked.
Go to Resources > WSL Integration.
Make sure your distribution (e.g., Ubuntu) has the toggle switched on.
Final verification
Let’s check that everything works. Open your PowerShell (or your Ubuntu terminal, both work because they are connected) and type:
docker run hello-world
If you see the message “Hello from Docker!”, Congratulations! You have a professional Docker environment on Windows.
How do you access them from Windows to edit code?
In Windows File Explorer, type in the address bar: \\wsl$
Enter Ubuntu -> home -> your_username.
Create your project folders there.
Open them with VS Code. VS Code will detect it’s WSL and install a small extension to work as if it were native.
Using the “Remote - WSL” extension from VS Code is the way to develop on Windows with Docker. You have the Windows interface, but the actual execution happens in the Linux Kernel at full speed.
The file system
Although WSL2 is fast, accessing files between Windows and Linux still has some overhead.
- If your code is in
C:\Users\Luis\Projectsand you mount it in Docker… it will be slow - If your code is inside the Linux file system… it will be much faster.
Get used to saving your projects inside the Linux distro.
