Introduction
Docker has become an important tool in modern software development. It is widely used when building, testing, and deploying applications because it allows developers to run applications in isolated environments called containers.
If you are a developer working with technologies such as Python, Django, FastAPI, Node.js, or databases, you will likely come across Docker sooner or later.
However, installing Docker on Windows can be slightly confusing for beginners because Docker Desktop commonly works together with WSL 2 (Windows Subsystem for Linux).
In this blog, we will understand what Docker is, why it is used, and then install Docker on Windows step by step.
The installation process in this guide was also tested on a Windows system using WSL 2 and Ubuntu 24.04 LTS.
1. What is Docker?
Docker is a platform that allows developers to package and run applications inside containers.
A container is an isolated environment where an application can run along with the things it needs.
For example, imagine that you have a Python application that requires:
Python
Django
Some libraries
Configuration
Application codeInstead of installing and configuring everything separately on every computer, Docker allows you to package the application and its required environment into a container.
A simple way to think about it is:
Application
+
Dependencies
+
Configuration
↓
ContainerThe container can then run on a system that supports Docker.
2. Why Do Developers Use Docker?
One common problem in software development is:
"It works on my computer, but it doesn't work on yours."
This can happen because different computers have different:
- Operating systems
- Python versions
- Node.js versions
- Libraries
- Dependencies
- Configurations
Docker helps reduce these differences by providing a consistent environment for running an application.
For example:
Developer's Computer
↓
Docker
↓
Container
↓
ApplicationThe same container can then be used in development, testing, and deployment environments.
Docker is commonly used for:
- Application development
- Testing
- Backend development
- Databases
- Microservices
- Deployment
- Development environments
3. What is a Container?
A container is an isolated environment in which an application runs.
For example, you could have:
Container 1
↓
Django Application
Container 2
↓
PostgreSQL Database
Container 3
↓
RedisThese containers can run on the same computer while remaining separated from each other.
This makes it easier to manage applications that depend on multiple services.
4. Docker Image vs Docker Container
Two terms you will frequently hear are:
Docker Image and Docker Container.
They are related but not the same.
Docker Image
An image is a packaged template containing everything needed to create a container.
For example:
Ubuntu Image
Python Image
Node.js Image
PostgreSQL ImageDocker Container
A container is a running instance created from an image.
Think of it like this:
Docker Image
↓
Create
↓
Docker Container
↓
RunA simple analogy is:
Image = Recipe
Container = Dish prepared using the recipe
5. What is Docker Desktop?
If you are using Windows, one of the easiest ways to use Docker is Docker Desktop.
Docker Desktop provides a graphical application that makes it easier to manage Docker.
It also provides the Docker Engine and command-line tools needed to create and run containers.
After installing Docker Desktop, you can interact with Docker through:
- Docker Desktop's graphical interface
- PowerShell
- Command Prompt
- Windows Terminal
- WSL/Ubuntu terminal
For this installation, we will use Docker Desktop + WSL 2.
6. Why Do We Need WSL 2?
WSL stands for:
Windows Subsystem for Linux
It allows you to run a Linux environment directly inside Windows without installing a traditional virtual machine or setting up dual boot.
Docker uses Linux technologies heavily, so on Windows, Docker Desktop can use WSL 2 as its backend.
Our setup looks like:
Windows
↓
WSL 2
↓
Ubuntu
↓
Docker Desktop
↓
Docker Engine
↓
ContainersYou don't need to understand the internal architecture deeply to install Docker, but knowing this relationship helps explain why WSL 2 is involved.
7. What Do We Need Before Installing Docker?
For this setup, we need:
- A supported Windows system
- WSL 2
- A Linux distribution such as Ubuntu
- Docker Desktop
In our installation, we used:
Windows
↓
WSL 2
↓
Ubuntu 24.04 LTS
↓
Docker Desktop8. Check Whether WSL is Installed
Before installing Docker, check whether WSL is already available.
Open PowerShell and run:
wsl --statusIf WSL is not installed, Windows may show a message telling you to install it.
You can install WSL using:
wsl --installYou may need to restart your computer after running this command.
9. Install Ubuntu on WSL 2
After WSL is installed, you can check the available Linux distributions:
wsl --list --onlineYou may see distributions such as:
Ubuntu
Ubuntu-24.04
Ubuntu-22.04
Debian
Kali LinuxFor our installation, we used Ubuntu 24.04 LTS.
We installed it using:
wsl --install -d Ubuntu-24.04Windows then installed Ubuntu and launched it.
During the first setup, Ubuntu asked us to create a Linux username and password.
For example:
Create a default Unix user account:
saicharan
New password:
********The password does not appear on the screen while you type it. This is normal behavior in Linux terminals.
10. Verify WSL 2 and Ubuntu
After installing Ubuntu, we can check the installed distributions using:
wsl -l -vOur system showed:
NAME STATE VERSION
Ubuntu-24.04 Running 2The important part is:
VERSION
2This confirms that Ubuntu is running using WSL 2.
At this point, our Windows system is ready for Docker Desktop.
11. Install Docker Desktop
Now we can install Docker Desktop.
Download Docker Desktop for Windows from the official Docker website.
During installation, Docker may provide options related to WSL 2.
Since we already configured WSL 2, make sure the WSL 2 option is enabled.
Complete the installation.
If Windows asks you to restart, restart the computer.
After restarting, open:
Docker Desktop
Docker may take a little time during its first startup.
Once everything is working, Docker Desktop should show that the Docker Engine is running.
12. Verify Docker Installation
Installing Docker Desktop is not enough. We should verify that Docker is actually working.
Open PowerShell and run:
docker --versionFor our installation, the result was:
Docker version 29.7.2, build a7dcaa6Your version may be different because Docker releases new versions over time.
The important thing is that the command returns a Docker version instead of an error.
13. Run Your First Docker Container
Now comes the most important test.
Run:
docker run hello-worldIf Docker is working correctly, Docker will download the hello-world image and create a container from it.
The first time we ran the command, Docker showed:
Unable to find image 'hello-world:latest' locallyThis simply meant that the image wasn't already available on our computer.
Docker then downloaded it:
Pulling from library/hello-worldAfter that, Docker created and ran the container.
Finally, we received:
Hello from Docker!
This message shows that your installation appears to be working correctly.This confirms that Docker is working correctly.
14. What Happened When We Ran docker run hello-world?
Although the command is very simple, several things happened behind the scenes.
docker run hello-world
↓
Docker checks for the image
↓
Image not found locally
↓
Docker downloads image from Docker Hub
↓
Docker creates a container
↓
Container runs
↓
Container displays the messageSo this one command verified that:
- Docker CLI is working
- Docker Engine is running
- Docker can connect to Docker Hub
- Docker can download images
- Docker can create containers
- Docker can run containers
That makes hello-world a useful first test after installing Docker.
15. A Few Useful Docker Commands
Once Docker is installed, these are some basic commands worth knowing.
Check Docker version
docker --versionCheck Docker information
docker infoDownload an image
docker pull ubuntuRun a container
docker run ubuntuRun Ubuntu interactively
docker run -it ubuntu bashThis starts an Ubuntu container and opens a shell inside it.
List running containers
docker psList all containers
docker ps -aList downloaded images
docker imagesThese commands are enough to get started. You don't need to memorize every Docker command before beginning.
16. Docker Hub
You may have noticed that our hello-world image was downloaded from:
Docker Hub
Docker Hub is a public registry where developers can find and share Docker images.
For example, you can find images for:
Ubuntu
Python
Node.js
PostgreSQL
MySQL
Redis
NginxWhen you run:
docker run hello-worldDocker can download the hello-world image from Docker Hub if it isn't already available locally.
17. Common Problems During Installation
WSL is not installed
If you see a message saying:
The Windows Subsystem for Linux is not installed.install it using:
wsl --installThen restart Windows if required.
No Linux distribution is installed
If:
wsl -l -vshows that there are no installed distributions, install one using:
wsl --install -d Ubuntu-24.04Docker Engine is not running
If Docker commands fail even though Docker Desktop is installed, open Docker Desktop and check whether the Docker Engine has started.
Wait until Docker Desktop indicates that the engine is running.
docker command is not recognized
If PowerShell says that:
dockeris not recognized, Docker Desktop may not have installed correctly or the terminal may need to be restarted.
Close PowerShell, reopen it, and try:
docker --version18. Our Complete Installation Process
The complete process we followed was:
Windows
↓
Check WSL
↓
Install WSL
↓
Restart Windows
↓
Check WSL
↓
Install Ubuntu 24.04 LTS
↓
Create Ubuntu username & password
↓
Verify WSL 2
↓
Install Docker Desktop
↓
Start Docker Desktop
↓
Verify Docker Engine
↓
Run docker --version
↓
Run docker run hello-world
↓
Docker Successfully Installed19. Final Verification
After completing the installation, these two commands are enough for a basic verification:
docker --versionand:
docker run hello-worldIf the second command displays:
Hello from Docker!
This message shows that your installation appears to be working correctly.your Docker installation is working successfully.
Conclusion
Docker allows developers to package and run applications in isolated environments called containers.
On Windows, Docker Desktop can work together with WSL 2 to provide the Linux environment required by Docker.
The installation process may initially look complicated because it involves several components, but the actual workflow is straightforward:
WSL 2
↓
Ubuntu
↓
Docker Desktop
↓
Docker Engine
↓
ContainersOnce Docker is installed and verified, you can start learning the more interesting part: how to actually use Docker to containerize your own applications.
