Installing Docker on Windows
Install Docker Desktop with the WSL 2 backend. Enabling virtualisation, the filesystem choice that makes builds ten times faster, and fixing startup errors.
Containers are a Linux kernel feature, so Windows runs them inside a lightweight Linux VM. Docker Desktop manages that VM for you through WSL 2, which is the supported and considerably faster backend. The older Hyper-V backend is deprecated.
Two things are worth knowing before you start. Windows Home is supported: the old Pro-only restriction applied to the Hyper-V backend and no longer applies with WSL 2. And where you keep your project files matters enormously for build speed. See the filesystem section below, because it is the difference most people never discover.
Prerequisites
Before installing Docker on Windows, ensure your system meets these requirements:
Windows Requirements
- Windows 10 or 11: 64-bit Pro, Enterprise, or Education (Build 19041 or higher)
- WSL 2: Windows Subsystem for Linux 2 must be enabled
- Virtualization: Hardware virtualization must be enabled in BIOS
- RAM: Minimum 4GB (8GB recommended)
Installing Docker Desktop on Windows
Docker Desktop is the easiest way to run Docker on Windows, providing a complete development environment with a user-friendly interface.
Step 1: Enable WSL 2
Open PowerShell as Administrator and run:
# Enable WSL
wsl --install
# Set WSL 2 as default version
wsl --set-default-version 2
Restart your computer after enabling WSL.
Step 2: Download Docker Desktop
Visit the official Docker website: https://www.docker.com/products/docker-desktop Click "Download for Windows" Run the installer (Docker Desktop Installer.exe)
Step 3: Install Docker Desktop
Double-click the installer to run it Ensure "Use WSL 2 instead of Hyper-V" is selected Follow the installation wizard Click "Close and restart" when prompted
Step 4: Start Docker Desktop
Launch Docker Desktop from the Start menu Accept the service agreement Wait for Docker to start (you'll see the Docker icon in the system tray) You may be asked to complete a tutorial
Step 5: Verify Installation
Open PowerShell or Command Prompt and run:
docker --version
docker run hello-world
You should see Docker's version information and a welcome message from the hello-world container.
Configuring Docker Desktop on Windows
Resources Allocation
Proper resource allocation ensures optimal performance:
CPU
- Development: 2-4 CPUs
- Production builds: 4-8 CPUs
Memory
- Minimal: 2GB
- Development: 4-8GB
- Heavy workloads: 8-16GB
Disk
- Minimal: 32GB
- Recommended: 64GB or more
Docker Desktop Settings
Access settings through the Docker Desktop menu:
-
General
- Start Docker Desktop when you log in
- Use WSL 2 based engine
- Send usage statistics (optional)
-
Resources
- Adjust CPU, Memory, Swap, and Disk limits
- Configure file sharing directories
-
Docker Engine
- Edit daemon.json for advanced configuration
- Configure registry mirrors
- Set insecure registries
-
WSL Integration
- Enable integration with your WSL 2 distros
- Select which distributions can access Docker
Troubleshooting Windows Installation
WSL 2 Not Available
Problem: "WSL 2 installation is incomplete"
Solution:
- Open PowerShell as Administrator
- Run:
wsl --install - Restart your computer
- Verify with:
wsl --status
Virtualization Not Enabled
Problem: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"
Solution:
- Restart your computer
- Enter BIOS/UEFI settings (usually F2, F10, or Del during boot)
- Find virtualization settings (Intel VT-x or AMD-V)
- Enable virtualization
- Save and exit BIOS
Docker Service Won't Start
Problem: Docker Desktop fails to start
Solution:
- Ensure WSL 2 is properly installed
- Check Windows Event Viewer for errors
- Try resetting Docker Desktop to factory defaults
- Reinstall Docker Desktop if necessary
Cannot Pull Images
Problem: "Error response from daemon: Get https://registry-1.docker.io/v2/"
Solution:
- Check internet connection
- Verify firewall settings
- Configure proxy if needed in Docker Desktop settings
Testing Your Installation
Let's verify everything works correctly:
1. Check Docker Version
docker --version
docker compose version
2. Run a Test Container
docker run -d -p 8080:80 nginx
Then visit http://localhost:8080 in your browser. You should see the Nginx welcome page!
3. List Running Containers
docker ps
4. Stop and Remove the Container
docker stop $(docker ps -q)
docker rm $(docker ps -aq)
Windows-Specific Tips
Using WSL 2 with Docker
Docker Desktop integrates seamlessly with WSL 2. You can:
- Run Docker commands from WSL 2 distributions
- Access Windows files from containers
- Use Linux-based development workflows
File Performance
For best performance:
- Store project files in the WSL 2 filesystem (not Windows filesystem)
- Access via
\\wsl$\Ubuntu\home\username\projects - Use WSL 2 terminal for development
PowerShell vs CMD
Docker works with both PowerShell and Command Prompt, but PowerShell is recommended for better scripting capabilities.
The filesystem choice that decides your build speed
The single most impactful setting on Windows, and it is not in any settings panel.
WSL 2 runs a real Linux filesystem. Your Windows drives are made available inside it at /mnt/c, but through a translation layer that is dramatically slower for the many-small-files access pattern that builds and node_modules produce. A project on /mnt/c/Users/you/app can build many times slower than the identical project inside the WSL filesystem.
Keep project files in the WSL 2 filesystem:
# Inside your WSL distribution. Fast
cd ~
git clone https://github.com/acme/app.git
cd app && docker build -t app .
# Reachable from Windows Explorer and editors
\\wsl$\Ubuntu\home\you\app
VS Code handles this properly with the WSL extension. Open the folder through Remote-WSL and the editor runs inside the distribution, so file watching and terminals are native speed.
The rule of thumb: Linux tools on Linux files, Windows tools on Windows files. Crossing the boundary is what costs you.
Where to go next
- Key Docker concepts: the object model in one page
- Docker images and containers
- Dockerfile basics: build your first image
- Docker volumes: and why bind mounts behave differently here
Key takeaways
- WSL 2 is the backend to use. Hyper-V is deprecated, and Windows Home is fully supported.
- Virtualisation must be on in BIOS or UEFI: check with
systeminfo | findstr /C:"Virtualization". - Keep code in the WSL filesystem, not
/mnt/c. This is the biggest performance factor on Windows. - Docker Desktop must be running before the CLI works; the CLI installs long before the VM boots.
- Cap WSL 2's memory in
.wslconfig:vmmemwill otherwise grow to a large share of your RAM. - Line endings matter. A CRLF shell script fails inside a container with a confusing "not found".
- Windows containers are a separate mode and unrelated to everyday Linux container work.
Check your understanding
A build that is ten times slower than a colleague's
On Windows with the WSL 2 backend, docker build on a Node project takes several minutes; a colleague on Linux takes twenty seconds with the same Dockerfile. The project lives in C:\Users\you\app. What is the most likely cause?
Frequently Asked Questions
Can I run Docker Desktop on Windows 10 or 11 Home?
Yes. The old requirement for Pro, Enterprise or Education applied to the Hyper-V backend, which needed a feature Home does not ship. The WSL 2 backend has no such dependency and is now the default and recommended option, so Home editions run Docker Desktop normally. You still need a 64-bit build 19041 or later, hardware virtualisation enabled in firmware, and WSL 2 installed.
Why is Docker so slow on Windows?
Almost always because the project lives on the Windows filesystem and is reached from WSL 2 through /mnt/c. That path crosses a translation layer that handles large sequential reads reasonably and the thousands of tiny file operations a build produces very poorly. Clone the repository inside the WSL distribution instead, cd ~ && git clone …, and open it with VS Code's Remote-WSL extension. Add a .dockerignore excluding node_modules and .git so the build context stays small either way.
How do I fix "WSL 2 installation is incomplete" or a failed WSL update?
Run wsl --install from an elevated PowerShell, then wsl --update and wsl --set-default-version 2, and reboot. If it still fails, the usual cause is virtualisation being disabled in firmware, systeminfo | findstr /C:"Virtualization" reporting No confirms it, and the setting is Intel VT-x or AMD-V, often labelled SVM Mode on AMD boards. Corporate machines sometimes also have the Virtual Machine Platform Windows feature disabled by policy, which wsl --install cannot override.
Why does Docker Desktop say the daemon is not running right after I installed it?
Because the CLI and the engine arrive together but start apart. docker.exe is on your PATH as soon as the installer finishes, while the Linux VM behind it takes a while to boot, so a command typed immediately gets "Cannot connect to the Docker daemon". Wait for the whale icon in the system tray to stop animating. If it never settles, check Docker Desktop's own diagnostics: the usual culprits are WSL 2 not fully installed or virtualisation switched off.
How much memory does Docker Desktop use on Windows, and can I limit it?
The WSL 2 VM (vmmem in Task Manager) grows as containers demand memory and by default may claim a large share of your RAM. Cap it by creating %UserProfile%\.wslconfig with a [wsl2] section setting memory=6GB and processors=4, then run wsl --shutdown and restart Docker Desktop. Note WSL 2 is slow to hand memory back to Windows even when containers stop, which is why an explicit cap is worth setting rather than relying on it releasing on its own.
What is the difference between Windows containers and Linux containers?
Linux containers are what essentially all tutorials, base images and production workloads mean by "containers", and on Windows they run inside the WSL 2 Linux VM. Windows containers are a separate mode that runs Windows processes against the Windows kernel, used for containerising .NET Framework and other Windows-only applications. You switch between modes from the Docker Desktop tray menu, and they cannot run at the same time. Unless you have specifically been asked for Windows containers, stay in Linux mode.