Docker Desktop for Windows 11 & 10: Complete Installation Guide

In this tutorial, we will learn how to install Docker on Windows 10 and 11. We will also learn how to start containers and switch between Linux containers and Windows containers.

By the end of this tutorial, you'll have Docker installed and be ready to start running containerized applications on your Windows computer.

Note that this guide is for Windows 10 and Windows 11. If you want to install Docker on Windows Server, there is a separate tutorial (click the link below).

How to Install Docker on Windows Server 2022

Before We Begin

Before setting up Docker on Windows 11, there are a few things to consider.

  • Docker Desktop is the official way to run Docker on Windows 11.
  • It leverages WSL 2, a Microsoft technology that lets you run Linux environments directly on Windows.
  • WSL 2 relies on a lightweight Hyper-V virtual machine, which can conflict with third-party hypervisors like VirtualBox or VMware Workstation.
  • So, if you rely on these tools for development or testing, installing Docker Desktop might cause issues.
  • An alternative solution is to run Docker on a Linux virtual machine within VirtualBox or VMware Workstation instead of installing Docker Desktop.

System Requirements

To install Docker Desktop, virtualization needs to be enabled. You can click the link below to learn how to check and enable virtualization on your computer.

How to Enable Virtualization on Windows 10 and 11

Docker Installation Guide (Full Walkthrough)

To install Docker Desktop on your computer, complete the following steps:

  1. Check if WSL 2 has been enabled.
  2. Download the Docker installer for Windows.
  3. Run the installer.

Check If WSL 2 Has Been Enabled

Our first step is to check if WSL 2 is enabled. To do that, run the following command in CMD or PowerShell:

wsl --status

If WSL 2 is installed you will see and output like following:

wsl 2 status

If you don't see any output that means WSL 2 is not installed. In that case you can install WSL 2 by running the wsl --install command.

wsl --install

Before running the command, make sure to open the Command Prompt or PowerShell console as an administrator.

You will need to restart your computer during the process. Once your computer has rebooted, it will install the Ubuntu distribution. This is part of the WSL 2 installation and is unrelated to Docker.

You can read the full WSL 2 installation guide at the bellow link.

How to Install WSL 2 on Windows

Download the Docker Installer for Windows

Ok, the next step is to download the docker desktop installer for Windows 11. To do that click on this link and then download the 86_64 installer at the top of the page.

Download Docker Desktop for Windows
Download Docker Desktop for Windows

Run the Installer

After the download is complete, run the installer. Continue with the recommended configuration and ensure the WSL 2 option is checked.

Install Docker on Windows 11

Once the installation is finished, you will be prompted to restart your computer. After that, it will start the Docker engine for the first time and present you with the Docker Desktop dashboard.

Docker Desktop on Windows 11
Docker Desktop on Windows 11

The Docker Desktop dashboard lets you manage containers visually. However, you also have the flexibility to use the Docker command through Command Prompt or PowerShell for more granular control.

How to Check Docker Version

Running Docker Containers on Windows

To make sure everything is working properly, we will start a test container using the hello-world image.

Open a command prompt and run the following command:

docker run hello-world

A successful setup will display the "Hello from Docker!" message, confirming that your Docker environment is ready to go.

Running Docker Containers on Windows

To learn more about the docker run command and how to create containers, click the link below.

How to start Docker containers using the Docker Run command

Linux Containers vs. Windows Containers

So here's the thing: Docker on Windows allows you to run two types of containers—Linux containers and Windows containers.

Most containers are based on Linux, but if you need to run a Windows operating system, like Windows Server, you'll need to use Windows container mode.

By default, Docker Desktop runs in Linux container mode. You can verify this by running the docker version command, which will show "Linux" as the server architecture.

Linux Containers vs. Windows Containers

To switch to Windows mode, right-click the Docker icon in the system tray and select "Switch to Windows containers…".

Switch to Windows containers
Switch to Windows containers

When you first switch to Windows containers, Docker Desktop will check if the Windows containers feature is enabled on your system. If not, it will prompt you to enable it before proceeding.

Enable Windows containers feature

Copy the provided command and run it in a PowerShell console to enable the containers feature.

Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All

After enabling Windows containers, you'll need to restart your computer for the changes to take effect. Once restarted, launch Docker Desktop from the desktop icon or Start menu shortcut. Wait for the Docker engine to fully initialize, then open a command prompt and run the docker version command.

docker version

This time, the server architecture should be Windows if you have switched to Windows containers mode.

Windows containers mode

To test Windows mode working properly, start a hello world container by running the following command:

docker run hello-world

A successful setup will display the "Hello from Docker!" message in your terminal, confirming that Windows container mode is functioning correctly.

Switching to Linux containers

While in Windows container mode, you cannot run applications built for Linux. To switch back to Linux containers and run Linux-based applications, right-click the Docker icon in the system tray and select "Switch to Linux containers…".

Switching to Linux containers

What Next?

Alright, that brings us to the end of this tutorial on setting up Docker Desktop on Windows 11! Now that you have Docker up and running, head over to our next tutorial to learn how to create containers using the docker run command.