Welcome to my Docker Essentials series, which teaches you the basics you’ll need to know in order to get started with Docker. In this video, I go over the installation process for Windows 10, macOS, and Ubuntu.
Installing Docker
Windows 10 and macOS
Ubuntu
For Ubuntu, the following commands are used to install Docker:
First, install updates
sudo apt update sudo apt dist-upgrade
Install the required package for Docker
sudo apt install docker.io
Ensure that Docker is started and enabled
By default, the Docker engine on Ubuntu won’t be running or enabled after you install the package. You can fix this by running the following commands:
sudo systemctl enable docker sudo systemctl start docker
Add your user to the docker group (optional)
sudo usermod -aG docker <username>
Running a test container
The “hello-world” container is a great way to test that Docker is installed and working properly. Regardless of the operating system, after installing Docker you can run the test container with the following command:
docker run hello-world
Note: You will need to prefix that command with ‘sudo’ on Ubuntu if you didn’t add your user to the docker group.