Install Docker
Last Updated: April 11, 2021
In this tutorial we will show you how install Docker on Windows, MacOs and Ubuntu
Windows
Windows 10 Home
-
For Windows 10 Home, see System requirements for WSL 2 backend.
-
After setting up WSL 2 backend proceed with the installation steps below.
Windows 10 Pro, Enterprise, or Education (Build 17134 or higher)
-
Download the latest version of Docker https://hub.docker.com/editions/community/docker-ce-desktop-windows/
-
Open the downloaded file to run Docker installer
-
Finish the installation
-
Open Docker and a Command line window
-
Now lets run the Docker getting-started example
This command will pull the Docker image and will run it docker run -d -p 80:80 docker/getting-started
-
Note how we have the image added to the Docker app home, with some useful actions
MacOS
-
Visit https://hub.docker.com/editions/community/docker-ce-desktop-mac/
-
Click on Get Docker
-
Open the installed file
-
Drag and drop Docker into Applications
-
Now open Docker
-
Give it the needed permissions (if applicable)
-
Now you should see the home of Docker app
Figure 1. Docker home -
You can check the status of Docker on the left-bottom corner. (if its green then Docker is running)
-
Now lets run the Docker getting-started example
-
Copy the command on the home page of the Docker app
docker run -d -p 80:80 docker/getting-started
-
Run it in the terminal
-
This command will pull the Docker image and will run it
Figure 2. Running Docker getting-started -
Note how we have the image added to the Docker app home, with some useful actions
Figure 3. Docker actions
Ubuntu
-
Update the list of available packages then install the newer versions of the packages
apt-get update && apt-get upgrade
-
Uninstall older version of Docker
sudo apt-get remove docker docker-engine docker.io
-
Install the newest version
sudo apt-get remove docker docker-engine docker.io
-
To verify that docker is installed
docker --version
Docker needs to be configured to run at startup sudo systemctl start docker sudo systemctl enable docker