How to Install Docker on Ubuntu
Table of Contents
These instructions work on Ubuntu versions 20.10 (Groovy), 20.04 (Focal), 18.04 (Bionic) and 16.04 (Xenial).
Step 1. Open a Terminal Session
If you're using an Ubuntu laptop or desktop, you can press
Ctrl + Alt + T on your keyboard to open a new terminal window. If you're using a remote Ubuntu server, you can connect using SSH to open a new terminal session.
Download Docker's Apt repo key:
Verify the fingerprint of the key you just downloaded by running the command:
and checking that the output matches this:
Run a Docker command to test that the installation worked:
If installation was successful, you should see the following output:
In the previous step, you had to use
sudo in front of the
docker command. To get rid of this requirement, first add the current user to the
docker user group:
Then exit the current terminal session:
The next time you login, you will be able to run Docker commands without
You are now ready to use Docker on your machine.