Maintenance

Site is under maintenance — quizzes are still available.

Go to quizzes

Install Docker Desktop on Windows

Step-by-step tutorial to install Docker Desktop on Windows for practical Docker mastery.

Focus: install docker desktop on windows

Sponsored

You just read the Docker introduction and are ready to start containerizing applications. But before you can run your first docker run or docker build command, you need the Docker engine itself running on your computer. For many developers, that means installing Docker Desktop on Windows — a process that can feel intimidating with its WSL2 hypervisor requirements and system settings. This tutorial walks you through every step so you go from zero to a running Docker daemon in under thirty minutes, avoiding the pitfalls that trip up new Windows users.

The problem this lesson solves

Docker was built for Linux. Getting it to work natively on Windows used to require a full virtual machine, complex configuration, and constant troubleshooting. Without a clean installation path, developers either avoided Docker on Windows or wasted hours fighting obscure errors like Hardware assisted virtualization and data execution protection must be enabled in the BIOS. Even after getting Docker installed, many struggled with broken container networking or slow file sharing. This lesson eliminates that pain by giving you a repeatable, verified installation process that works on modern Windows 10 and Windows 11 systems.

What happens if you skip proper installation

  • WSL2 kernel panic on first launch – because the Linux kernel update wasn't installed
  • Docker Desktop fails to start – because virtualization is disabled in BIOS
  • Containers can't access the internet – because Windows Defender or corporate VPN blocks the Docker bridge
  • File changes don't sync – because you chose the wrong file sharing backend

Core concept / mental model

Think of Docker Desktop on Windows as a three-layer stack:

  1. The Linux VM – A lightweight, managed virtual machine (WSL2 or Hyper-V) that hosts the Docker engine
  2. The Docker daemon (dockerd) – The background service that manages containers, images, and networks inside that Linux VM
  3. The Docker client (docker) – The command-line tool you run in PowerShell or CMD that talks to the daemon

It's essential to understand that Docker containers are not Windows processes. They run inside that Linux VM, sharing its kernel. When you type docker ps in your terminal, the client sends an HTTP request to the daemon inside the VM, which responds with the list of running containers.

Pro tip: This separation is why Windows containers (which run Windows Server core) are a different product. Docker Desktop defaults to Linux containers, which is what 98% of tutorials expect.

The WSL2 backend vs. Hyper-V backend

Docker Desktop supports two backends. The recommended one – and the focus of this guide – is WSL2 (Windows Subsystem for Linux 2). It starts faster, uses less memory, and integrates seamlessly with tools like VS Code's Remote - WSL extension. The older Hyper-V backend creates a full separate VM, which is slower and more resource-hungry.

Backend Startup time Memory overhead File sharing speed Best for
WSL2 ~5 seconds ~500MB Fast (wsl2 mount) Most developers, VS Code users
Hyper-V ~30 seconds ~1.5GB Slow (SMB share) Enterprise machines without WSL2 support

How it works step by step

The installation process follows a sequential path. Skipping any step causes failure later.

Step 1: Enable virtualization in BIOS

Docker requires hardware-assisted virtualization (Intel VT-x or AMD-V). It's often disabled by default on branded PCs (Dell, HP, Lenovo).

  1. Restart your PC and press the BIOS key (usually F2, F10, Del, or Esc)
  2. Look for Intel Virtualization Technology or SVM Mode (AMD)
  3. Set it to Enabled
  4. Save and exit

Step 2: Install WSL2

Open PowerShell as Administrator and run:

# Install WSL and set version 2 as default
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Then restart your PC. After reboot, download and install the WSL2 Linux kernel update package from the Microsoft WSL2 documentation page.

Blockquote: Not installing the kernel update is the #1 cause of wsl --version errors. Run the .msi package even if WSL shows "installed".

Step 3: Set a default WSL2 distro (optional but recommended)

Docker Desktop uses a default Linux distribution for its backend. You can install Ubuntu:

wsl --install -d Ubuntu

Wait for the Ubuntu terminal to launch, create a Linux user/password when prompted. You can ignore this step – Docker Desktop will create its own lightweight docker-desktop distro anyway.

Step 4: Download and install Docker Desktop

  1. Go to hub.docker.com and create a free account (or sign in)
  2. Download Docker Desktop for Windows (stable channel)
  3. Run the installer as Administrator (right-click → Run as administrator)
  4. When prompted, check Use WSL 2 instead of Hyper-V (this is critical!)
  5. Accept the defaults and let it finish

Step 5: Start Docker Desktop and verify

After installation, Docker Desktop launches automatically. You'll see the whale icon in your system tray spinning green – then solid. Wait until it's solid.

Open PowerShell or CMD and run:

docker version

Expected output (actual versions vary):

Client: Docker Engine - Community
 Version:           26.1.4
 ...
Server: Docker Desktop
 Engine:
  Version:          26.1.4

If you see both Client and Server blocks, the daemon is running. Congratulations – you've installed Docker Desktop on Windows.

Hands-on walkthrough

Let's run a real container to confirm everything works.

Example 1: Hello World

docker run hello-world

Expected output:

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

Example 2: Run an interactive busybox container

docker run -it busybox sh

Inside the container, run:

ls /bin

You'll see a minimal set of GNU utilities. Type exit to leave.

Example 3: Verify resource usage and WSL2 integration

Open a PowerShell and run:

wsl -l -v

Expected output:

  NAME                   STATE           VERSION
* docker-desktop         Running         2
  docker-desktop-data    Running         2

This proves Docker is using WSL2, not Hyper-V.

Example 4: Run a web server

docker run -d -p 8080:80 --name mynginx nginx:alpine

Open your browser and navigate to http://localhost:8080. You should see the nginx welcome page. Then stop and remove the container:

docker stop mynginx
docker rm mynginx

Compare options / when to choose what

Docker Desktop isn't the only way to run Docker on Windows. Here's how it compares to alternatives:

Method Docker Desktop Docker Engine via WSL2 (no GUI) Docker Toolbox (legacy)
GUI dashboard Yes No Yes (Kitematic)
Automatic updates Yes Manual No longer maintained
Kubernetes support Built-in Add manually No
Resource efficiency ~500MB RAM ~300MB RAM ~1GB RAM
Linux container support Yes (WSL2) Yes (WSL2) Yes (VirtualBox VM)
Best for Beginners, GUI fans, Kubernetes learners Pros who want minimal overhead Never – it's deprecated

When to skip Docker Desktop: If you're comfortable with Linux CLI, you can install Docker Engine directly inside WSL2 Ubuntu (via apt) and access it from Windows using docker context. But for 95% of developers, Docker Desktop is the simpler, safer choice.

Troubleshooting & edge cases

"Docker Desktop requires a newer WSL2 kernel"

Cause: You skipped the kernel update .msi download. Fix: Download wsl_update_x64.msi from the WSL2 Kernel Update page and install it. Then restart Docker Desktop.

"Hardware assisted virtualization is not enabled"

Cause: Virtualization is off in BIOS, or Hyper-V is disabled on systems that don't use WSL2. Fix: 1. Reboot into BIOS and enable virtualization 2. Run PowerShell as Admin: bcdedit /set hypervisorlaunchtype auto 3. Restart and try again

Docker Desktop shows "Containers" but docker ps returns nothing

Cause: Docker context switched to a remote host or a different node. Fix:

docker context ls
docker context use default

Docker Desktop won't start after Windows Update

Cause: Windows Update sometimes resets WSL features or virtualization settings. Fix: Re-run the WSL2 enable commands from Step 2, then "Repair" Docker Desktop from Windows Settings → Apps → Docker Desktop → Modify.

What you learned & what's next

You now have a running Docker Desktop environment on Windows. You understand:

  • The three-layer architecture: WSL2 VM → Docker daemon → Docker client
  • How to enable virtualization and install WSL2 prerequisites
  • How to install Docker Desktop with the correct WSL2 backend
  • How to verify installation with docker version and docker run hello-world
  • How to choose between Docker Desktop and headless Docker engine

This foundation sets you up for everything that follows in the Docker track. In the next lesson, you'll learn to build your first Docker image using a Dockerfile – taking you from "I can run someone else's container" to "I can package my own application."

Practice recap

Open Docker Desktop and pause the engine from the dashboard. Then run docker run -d -p 80:80 nginx in PowerShell. Observe that Docker returns "Cannot connect to the Docker daemon." Once you restart the engine, the command works. This exercise reinforces the daemon/client model and shows how to recover from a stopped engine.

Common mistakes

  • Skipping the WSL2 kernel update .msi installation leads to 'WSL2 kernel version too old' errors
  • Disabling Windows Defender or corporate VPN breaks Docker's internal network – ensure Docker is allowed through the firewall
  • Using the Hyper-V backend when WSL2 is available increases memory usage and slows file sharing unnecessarily
  • Forgetting to run the installer as Administrator (right-click → Run as administrator) causes silent failures
  • Choosing a custom installation path with non-ASCII characters causes Docker engine startup failures

Variations

  1. Install Docker Engine directly inside WSL2 Ubuntu using sudo apt install docker.io for a lighter-weight setup without the GUI
  2. Use Docker Desktop with the Hyper-V backend on machines that lack WSL2 support (e.g., Windows 10 1903 and earlier)
  3. Manage multiple Docker contexts to switch between Docker Desktop and a remote server or cloud environment

Real-world use cases

  • Local development: Run a Node.js API inside a container while editing code in VS Code, with live file sync via WSL2
  • CI/CD pipeline testing: Install Docker Desktop on a Windows build agent to run containerized integration tests before deployment
  • Microservices learning: Spin up PostgreSQL, Redis, and your app in separate containers using Docker Compose on a single Windows dev machine

Key takeaways

  • Docker Desktop on Windows uses a Linux VM (WSL2 by default) to host the Docker daemon – containers are Linux processes, not Windows ones
  • Enable virtualization in BIOS, install WSL2 and the kernel update, then run the Docker Desktop installer with the WSL2 option
  • Verify installation with docker version (shows client and server) and docker run hello-world
  • Use wsl -l -v to confirm both docker-desktop distros are running on WSL2 version 2
  • Choose Docker Desktop for GUI, automatic updates, and built-in Kubernetes; choose headless engine for minimal resource usage

Sponsored

Sponsored

Discussion

Questions, corrections, and tips help everyone reading this page.

0 comments

Add a comment

Shown publicly with your comment.

Be constructive · max 4,000 characters

No comments yet — start the thread.

Related tutorials, quizzes, and articles for this topic.