How to Install Docker on Your System (Windows, macOS & Linux)
Docker has become one of the most powerful tools in modern software development. Whether you’re a developer, sysadmin, or DevOps engineer, Docker helps you package, ship, and run your applications in lightweight containers — ensuring consistency across environments. In this guide, we’ll walk through how to install Docker on Windows, macOS, and Linux step by step.
What is Docker?
Docker is an open-source platform that automates application deployment inside containers.
Containers are lightweight, portable units that package your code, dependencies, and system libraries — ensuring your app runs anywhere.
Think of containers as lightweight virtual machines that start instantly and use fewer resources.
Prerequisites
Before installing Docker, make sure your system meets these requirements:
64-bit processor
4 GB+ RAM
Internet connection
Administrator or root privileges
Installing Docker on Windows
Step 1: Enable WSL 2 (Windows Subsystem for Linux)
Docker Desktop requires WSL 2 backend on Windows.
Open PowerShell as Administrator and run:
wsl --install
Once installation completes, restart your system.
Step 2: Download Docker Desktop
Go to the official Docker website:
https://www.docker.com/products/docker-desktop
Download the Windows Installer (.exe) and run it.
Step 3: Complete Installation
Follow the setup wizard.
Make sure “Use WSL 2 instead of Hyper-V” is selected.
After installation, open Docker Desktop — it will start the Docker engine automatically.
Step 4: Verify Installation
Open a terminal (PowerShell or CMD) and type:
docker --version
You should see something like:
Docker version 27.0.3, build 1234567
Installing Docker on macOS
Step 1: Download Docker Desktop for Mac
Visit:
https://www.docker.com/products/docker-desktop
Choose the version for your chip:
Apple Silicon (M1/M2)
Intel Chip
Step 2: Install Docker
Double-click the .dmg
file → drag Docker.app to Applications.
Launch Docker from Applications or Spotlight.
Step 3: Verify Installation
Open Terminal and run:
docker --version
If installed correctly, you’ll see the version number.
Installing Docker on Linux (Ubuntu Example)
Step 1: Uninstall Old Versions
sudo apt remove docker docker-engine docker.io containerd runc
Step 2: Install Dependencies
sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release
Step 3: Add Docker’s Official GPG Key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Step 4: Set up the Docker Repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 5: Install Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 6: Verify Installation
sudo docker run hello-world
If you see “Hello from Docker!”, your setup is working perfectly ✅
Post-Installation (Optional)
To use Docker without sudo
(Linux):
sudo usermod -aG docker $USER
newgrp docker
Now you can run:
docker ps
without needing sudo
.
Bonus: Install Docker Compose (If Not Included)
Docker Compose lets you run multi-container apps with a single file.
To install manually:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Conclusion
You’ve successfully installed Docker on your system!
Now you can containerize your applications and simplify deployments across different environments.
Next step: Learn how to build and run your first Docker container in our next article — “Creating Your First Docker Image: A Beginner’s Guide”.