System Administration Video Tutorials

How to Install and Use Docker on Ubuntu


Docker is an application that simplifies the process of managing application processes in containers. Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers are more portable, more resource-friendly, and more dependent on the host operating system.

There are two ways

The slow way:


OS requirements

To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:

  • Ubuntu Focal 20.04 (LTS)
  • Ubuntu Eoan 19.10
  • Ubuntu Bionic 18.04 (LTS)
  • Ubuntu Xenial 16.04 (LTS)

Uninstall old versions

Older versions of Docker were called, or docker-engine. If these are installed, uninstall them:

$ sudo apt-get remove docker docker-engine containerd runc

Install using the repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.


    1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:
      $ sudo apt-get update
      $ sudo apt-get install \
          apt-transport-https \
          ca-certificates \
          curl \
          gnupg-agent \
    2. Add Docker’s official GPG key:
      $ curl -fsSL | sudo apt-key add -

      Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

      $ sudo apt-key fingerprint 0EBFCD88
      pub   rsa4096 2017-02-22 [SCEA]
            9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
      uid           [ unknown] Docker Release (CE deb) <[email protected]>
      sub   rsa4096 2017-02-22 [S]
    3. Use the following command to set up the stable repository.

      $ sudo add-apt-repository \
         "deb [arch=amd64] \
         $(lsb_release -cs) \


  1. Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
     $ sudo apt-get update
     $ sudo apt-get install docker-ce docker-ce-cli
  2. Verify that Docker Engine is installed correctly by running the hello-world image.
    $ sudo docker run hello-world

The Quick Way:

  1. Download the Install Script:
    $ wget
  2. Make it Executable:
    $ chmod +x
  3. Run it as root:
    $ sudo ./