Installing Docker
In this lesson, you’ll learn how to install Docker on different operating systems.
Prerequisites
- A computer with Windows, macOS, or Linux
- Administrator/sudo access
- At least 4GB of RAM
Installation Steps
For macOS
- Download Docker Desktop from the official website
-
Open the downloaded
.dmgfile - Drag Docker to Applications folder
- Launch Docker from Applications
For Windows
- Enable WSL 2 feature
- Download Docker Desktop for Windows
- Run the installer
- Restart your computer
For Linux (Ubuntu)
# Update package index
sudo apt-get update
# Install required packages
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# Add Docker's GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add Docker repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Install Docker
sudo apt-get update
sudo apt-get install docker-ce
Verify Installation
After installation, verify Docker is working:
docker --version
docker run hello-world
Next Steps
Now that Docker is installed, we’ll move on to understanding Docker images in the next lesson.