Docker is a powerful containerization platform that allows developers to package applications with all their dependencies into a single container. It simplifies deployment and ensures consistency across different environments. If you’re wondering how to install Docker on Windows, this guide will take you through the process step by step.
Whether you’re using Windows 11, Windows 10, or Windows Server editions (2016, 2019, 2022), this guide will provide instructions tailored to your system. You’ll also learn how to install Docker without Docker Desktop, using WSL (Windows Subsystem for Linux), on virtual machines, and from the command line.
System Requirements for Installing Docker on Windows
Before you Install Docker Toolbox on Windows, ensure that your Windows system meets the minimum requirements:
For Windows 10 and 11
-
Windows 10 (Pro, Enterprise, or Education) version 1909 or later
-
Windows 11 (Pro, Enterprise, or Education)
-
Hyper-V and WSL 2 enabled
-
At least 4GB of RAM
For Windows Server (2016, 2019, 2022)
-
Windows Server editions with container support enabled
-
Hyper-V and Windows Containers feature installed
Interested to know the differences between Docker vs Kubernetes or Docker vs Podman? Make sure to check out our article on these topics.
How to Install Docker on Windows 11
Step 1: Download Docker for Windows
To install Docker on Windows 11, the easiest way is through Docker Desktop.
-
Download Docker Desktop from the official Docker website.
-
Open the installer and follow the on-screen instructions.
-
When prompted, ensure WSL 2 is selected as the default backend.
-
Click Install and wait for the process to complete.
-
Launch Docker Desktop installed file and sign in with your Docker Hub account.
Step 2: Verify Docker Installation
To check if Docker is installed, open PowerShell and run:
docker --version
If Docker is correctly installed, you’ll see the version number displayed.
How to Install Docker on Windows 10 Step by Step
If you’re using Windows 10, follow these steps:
Step 1: Enable Virtualization
-
Ensure that virtualization is enabled in your system’s BIOS settings.
-
Enable Windows Hyper-V by running the following command in PowerShell as administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Step 2: Install WSL 2
To install Docker on Windows 10 using WSL 2, install the latest version of WSL by running:
wsl --install
Then restart your computer.
Step 3: Download and Install Docker
-
Download Docker Desktop from Docker’s official website.
-
Run the installer and follow the prompts.
-
Select WSL 2 as the backend during installation.
-
Click Install and wait for completion.
Step 4: Start and Verify Docker
Launch Docker Desktop and open a command prompt or PowerShell. Run:
docker run hello-world
If Docker is working correctly, you’ll see a welcome message.
How to Install Docker on Windows Server
For Windows Server 2016, 2019, and 2022, you need to install Docker manually.
Step 1: Install Windows Containers Feature
Open PowerShell as Administrator and run:
Install-WindowsFeature -Name Containers -Restart
After the restart, install the Docker Package:
Install-Package -Name docker -ProviderName DockerMsftProvider
Restart your system again.
Step 2: Start Docker Service
After installation, start the Docker service:
Start-Service docker
To enable it to start automatically on boot, use:
Set-Service -Name docker -StartupType Automatic
Step 3: Verify Installation
Run:
docker version
If Docker is installed correctly, you will see version details. Check out our article called Dedicated Server for Docker Deployment for more information.
How to Install Docker on Windows Without Docker Desktop
If you don’t want to use Docker Desktop, you can install Docker Engine directly.
Step 1: Install WSL 2 and a Linux Distribution
Run the following command to install WSL 2:
wsl --install
Then, install a Linux distribution like Ubuntu:
wsl --set-version Ubuntu 2
Step 2: Install Docker Engine on WSL
Inside WSL, install Docker with:
sudo apt update
sudo apt install docker.io -y
Step 3: Enable Docker Service
Run:
sudo service docker start
To check if Docker is running:
docker –version
Curious to know What is Docker Swarm? Make sure to read our guide about it.
How to Install Docker on Windows Using CMD
You can install Docker using the command line by running these steps in PowerShell or CMD as Administrator:
Invoke-WebRequest -UseBasicParsing -OutFile docker.zip https://download.docker.com/win/static/stable/x86_64/docker-20.10.5.zip
Expand-Archive -Path docker.zip -DestinationPath C:\docker
Then, add Docker to the system path:
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\docker", [System.EnvironmentVariableTarget]::Machine)
Verify installation with:
docker --version
How to Install Docker on Windows VM
Running Docker inside a Virtual Machine (VM) requires additional configurations to ensure compatibility and smooth performance. Here’s a step-by-step guide to setting up Docker on a Windows-based VM.
Step 1: Enable Nested Virtualization
Nested virtualization is required to run Docker inside a VM because Docker relies on virtualization features. Ensure that your host machine and hypervisor support nested virtualization.
-
For Hyper-V (Windows Virtualization):
-
Open PowerShell as Administrator on the host machine.
-
Run the following command to enable nested virtualization:
Set-VMProcessor -VMName "<Your_VM_Name>" -ExposeVirtualizationExtensions $true
-
Restart the VM for changes to take effect.
-
For VMware:
-
Open VMware Workstation or ESXi.
-
Go to the VM settings, then navigate to the "Processor" section.
-
Check the box "Virtualize Intel VT-x/EPT or AMD-V/RVI" (or a similar option).
-
Save changes and restart the VM.
Step 2: Verify System Requirements
Before installing Docker inside the VM, make sure your VM meets the following specifications:
-
At least 4GB of RAM (8GB recommended).
-
A 64-bit processor with virtualization support.
-
Windows 10, Windows 11, or Windows Server as the guest OS.
-
WSL 2 and Hyper-V should be enabled inside the VM if using Docker Desktop.
Step 3: Install Docker Based on Your Windows Version
Now, follow the appropriate steps for your Windows VM:
-
For Windows 10 or 11:
-
Install Docker Desktop (recommended).
-
Ensure that WSL 2 is installed using the command:
wsl --install
-
Download and install Docker Desktop from the Docker official website.
-
During installation, select WSL 2 backend as the preferred option.
-
Complete the installation and restart the VM.
-
For Windows Server (2016, 2019, 2022):
-
Open PowerShell as Administrator.
-
Install the Containers feature:
Install-WindowsFeature -Name Containers -Restart
-
After the restart, install Docker using the package manager:
Install-Package -Name docker -ProviderName DockerMsftProvider
-
Restart the VM again and start the Docker service:
Start-Service docker
-
Enable Docker to start automatically on system boot:
Set-Service -Name docker -StartupType Automatic
Step 4: Verify Docker Installation
Once Docker is installed, test if it's working by running:
docker --version
If installed correctly, the command will return the Docker version number.
To verify Docker can run containers, execute:
docker run hello-world
If successful, you will see a message confirming that Docker is installed and running correctly.
How to Install and Use Docker on Windows
Once Docker is installed on Windows, you can start using it to manage and deploy containerized applications. Below are the essential commands and operations to get started.
Running Your First Container
To test your Docker installation, run:
docker run hello-world
This command:
-
Pulls a test image from Docker Hub.
-
Creates and runs a new container from the image.
-
Displays a confirmation message if successful.
Pulling an Image from Docker Hub
Docker Hub is a public repository of pre-built container images. You can pull an image using:
docker pull ubuntu
This downloads the latest Ubuntu image, which can then be used to create containers.
Running a Container in the Background
To run an NGINX web server in the background, use:
docker run -d -p 8080:80 nginx
-
-d runs the container in detached mode (background).
-
-p 8080:80 maps port 8080 of your local machine to port 80 inside the container.
-
nginx is the name of the image being used.
To check running containers, use:
docker ps
To stop a running container, use:
docker stop <container_id>
For more details on Docker Installation, visit:
Conclusion
Now you know how to install Docker on Windows, whether it's Windows 10, Windows 11, or Windows Server. You also learned how to install Docker without Docker Desktop, using WSL, CMD, or a Windows VM.
If you're looking for Docker hosting solutions, check out Docker VPS Hosting for optimized performance.
Ready to start using Docker? Download Docker today and streamline your containerized applications!