Docker has revolutionized the world of software development by providing a lightweight and efficient way to containerize applications. Install Docker on Windows machine can unlock a world of possibilities for running applications in isolated containers, ensuring consistency across environments. Whether you’re developing microservices, testing applications, or deploying environments, Docker can make everything easier.
In this comprehensive guide, we will walk you through the steps to install Docker on Windows. Whether you’re using Windows 10 or Windows 11, we’ve got you covered!
Prerequisites
Before starting with the Docker installation on Windows, make sure you have the following:
- Windows 10 Pro, Enterprise, or Education (64-bit) or Windows 11.
- Docker Desktop requires Windows 10 or Windows 11 with support for Hyper-V and Windows Subsystem for Linux 2 (WSL 2). Docker Desktop can run on Home editions with WSL 2 enabled.
- System Requirements:
- A 64-bit processor with at least 4GB of RAM.
- Hardware virtualization enabled in the BIOS/UEFI.
- Administrator Rights: Make sure you have administrator access to install software on your machine.
- WSL 2: For Windows Home and Pro, Docker Desktop uses the Windows Subsystem for Linux 2. If you are using Windows 10, you need to install and configure WSL 2. WSL 2 is required for a smooth Docker experience, as it allows Docker containers to run natively within a Linux kernel on Windows.
Now, let’s go ahead and install Docker on Windows!

Step 1: Download Docker Desktop for Windows
- Go to the Official Docker Website:
- Open your browser and navigate to the official Docker download page: Download Docker Desktop for Windows.
- Choose the Correct Version:
- Docker will automatically detect your operating system and suggest the appropriate version for you. For Windows 10 and 11, click on the “Download for Windows” button.
- Download the Installer:
- Once you click the button, the Docker Desktop installer will begin downloading. The file size is around 500MB, so it may take some time depending on your internet speed.
Step 2: Install Docker Desktop on Windows
- Run the Installer:
- Once the download is complete, open the Docker Desktop installer file (
Docker Desktop Installer.exe
).
- Once the download is complete, open the Docker Desktop installer file (
- Follow the Installation Wizard:
- The installation process will guide you through a series of prompts. Click “OK” and accept the license agreement.
- The installer will prompt you to enable Hyper-V and Windows Subsystem for Linux 2 (WSL 2), which are required for Docker to run on Windows. The installer can automatically enable these features if they are not already enabled.
- Restart Your PC:
- After installation, the system will ask you to restart your computer to apply changes and finish the setup.
- Start Docker Desktop:
- Once your PC restarts, Docker Desktop should automatically launch. You can also manually open it by searching for “Docker” in the Start menu.
Step 3: Configure Docker Desktop
- Enable WSL 2 Backend (if not automatically enabled):
- Docker Desktop uses WSL 2 on Windows, which offers better performance than the older Hyper-V backend. If it’s not already enabled during installation, you’ll need to enable WSL 2 manually.
- Check WSL 2 Installation:
- Open PowerShell and run the following command to check the status of WSL:
wsl --list --verbose
If the output shows that WSL 2 is not installed, run the following command to install it:wsl --set-default-version 2
- Download and Install a Linux Distribution:
- If you haven’t installed a Linux distribution, you will need to do so. You can get a distribution (like Ubuntu) from the Microsoft Store.
wsl --set-default Ubuntu
- Configure Docker Settings:
- Open Docker Desktop by clicking the Docker icon in your system tray.
- Right-click on the Docker icon and select Settings. From here, you can tweak Docker’s settings such as memory allocation, CPU limits, and more. The default settings are typically sufficient for most users, but you may want to adjust them for larger workloads.
- Login to Docker Hub:
- Docker Hub is Docker’s official cloud-based registry where you can pull container images. You can either use Docker without an account, but having an account allows you to push and pull images from your private repositories.
- You can log in to Docker Hub directly from the Docker Desktop UI.
Step 4: Verify Docker Installation
After completing the installation and configuration steps, you can verify that Docker is installed correctly.
- Open Command Prompt or PowerShell:
- Type
docker --version
to check if Docker is installed and running. The output should show the installed version of Docker, like:
Docker version 20.10.7, build f0df350
- Type
- Check Docker Compose Version (optional):
- Docker Compose is automatically installed with Docker Desktop. To verify its installation, run:
docker-compose --version
The output should look like this:docker-compose version 1.29.2, build 5becea4c
- Run the Hello World Container:
- To confirm that Docker is working correctly, run the following command:
docker run hello-world
This command will pull a test image from Docker Hub and run it in a container. If everything is set up correctly, you’ll see a success message.
Step 5: Using Docker on Windows
Now that Docker is installed, you can start using it to build, run, and manage containers. Here are some basic commands to get you started:
- Pull a Docker Image:
- To download a Docker image from Docker Hub, use the
docker pull
command. For example, to download the latest version of the Nginx image:
docker pull nginx
- To download a Docker image from Docker Hub, use the
- Run a Docker Container:
- To run a container from the Nginx image you just pulled, use:
docker run -d -p 8080:80 nginx
This will run Nginx in the background (-d
), exposing port 8080 on your machine and mapping it to port 80 inside the container. - List Running Containers:
- To view all the running containers, use the command:
docker ps
- Stop a Docker Container:
- To stop a running container, use the
docker stop
command, followed by the container ID or name:
docker stop <container-id>
- To stop a running container, use the
Troubleshooting
- Docker Desktop Doesn’t Start:
- If Docker Desktop isn’t starting, make sure that Hyper-V and WSL 2 are properly enabled. Check the Docker Desktop settings and ensure that WSL 2 is selected as the backend.
- Out of Memory Errors:
- If Docker containers are running out of memory, adjust the Docker settings to allocate more resources (memory and CPU) under the Docker Desktop settings.
- WSL 2 Not Installed:
- If WSL 2 is not installed, follow the steps mentioned earlier to install it using PowerShell.
Conclusion
In this guide, we’ve gone through the process of install Docker on Windows, configuring Docker Desktop, and verifying the installation. Docker is an incredibly powerful tool for managing containers, and with Docker Desktop on Windows, you can easily build and deploy applications in isolated environments.
By following these steps, you should now have Docker running smoothly on your Windows machine. Whether you’re a developer working with microservices, managing databases, or running isolated test environments, Docker provides the flexibility and performance you need.
Happy Dockerizing!
Read Also : How to Install Docker Compose on Windows?