How to Install and Set Up Docker on Windows, Mac, and Linux: Step-by-Step Guide

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. This guide will walk you through the installation and setup process for Docker on Windows, Mac, and Linux.
1: System Requirements
Before installing Docker, ensure your system meets the following requirements:
- Windows: Windows 10 64-bit: Home or Pro 21H2 or higher, or Enterprise or Education 21H2 or higher. WSL 2 backend.
- Mac: macOS version 11 or newer. (Big Sur, Monterey, or Ventura). At least 4 GB of RAM.
- Linux: A 64-bit version of a supported Linux distribution (e.g., Ubuntu, Debian, Fedora, CentOS).
2: Installing Docker on Windows
- Download Docker Desktop: Visit the official Docker website and download the installer for Windows.
- Run the Installer: Double-click the downloaded file and follow the installation prompts. Ensure you enable the WSL 2 feature if prompted.
- Launch Docker Desktop: Once installed, launch Docker Desktop from the Start menu. It might take a few minutes to start the Docker Engine.
3: Installing Docker on Mac
- Download Docker Desktop: Go to the official Docker website and download the installer for macOS (choose Apple Chip or Intel Chip).
- Run the Installer: Open the downloaded .dmg file and drag the Docker icon to the Applications folder.
- Launch Docker Desktop: Once installed, you can use Docker from the Terminal application after launching Docker Desktop from the Applications folder.
4: Installing Docker on Linux
- Set up the repository: Update the `apt` package index and install packages to allow `apt` to use a repository over HTTPS.
- Add Docker's official GPG key:
- Set up the repository:
- Install Docker Engine:
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
5: Verifying Docker Installation
After installing Docker, you should verify that it is running correctly:
- Run the Hello World container: Run the following command in your terminal or command prompt:
- Check Docker Version: Run the following command to check the installed version:
docker run hello-world
docker --version
6: Conclusion
Congratulations! You have successfully installed and set up Docker on your system. You can now start using Docker to build and run containerized applications.
7: Essential Resources
Explore our collection of useful resources and downloads to enhance your experience:
- Docker Documentation: Access the official Docker documentation for more advanced features.
- Docker Hub: Find and share container images on Docker Hub.
FAQ
Q: Is Docker free to use?
A: Docker Desktop is free for small businesses, personal use, education, and non-commercial open source projects. A paid subscription is required for professional use in large enterprises.
Q: How do I uninstall Docker?
A: You can uninstall it through the Apps & features on Windows, by moving it to Trash from the Applications folder on Mac, or using your package manager on Linux.