This article is written for those who were searching for a detailed and simple for the understanding guide on how to install Docker Engine – Community on Ubuntu Server.

Docker is a container management system, it allows you to “pack” an application or website with all its surroundings and dependencies into a container that you can easily manage. For example, migrate to another server, scale or update.

To install Docker Engine – Community, you will need a 64-bit version of one of the following versions of Ubuntu:

  • Disco 19.04
  • Cosmic 18.10
  • Bionic 18.04 (LTS)
  • Xenial 16.04 (LTS)

In this guide, we will consider the case when you already have a server with the Ubuntu Server 18.04 LTS operating system installed on it.

You can read more about how to install Ubuntu Server 18.04 LTS in my guide «Installing Ubuntu Server 18.04 LTS».

In addition, OpenSSH must be installed on the server, and port 22 must be open in order to be able to connect to the server using the SSH protocol.

To install OpenSSH on the server, you can use the command:

sudo apt-get install openssh-server

If you plan to connect to the server using the Windows operating system, you can use PuTTY, a freeware client for various remote access protocols, including SSH, Telnet, rlogin.

This guide covers connecting to a server using the iTerm2 terminal emulator installed on the macOS operating system.

Connect to the server on which it is planned to install Docker Engine – Community.

Next, you must confirm that we trust the server to which we are connecting.

Enter “yes” and press the “Enter” button.

First, you need to connect the Docker repository. This will make it possible not only to install easily but also to update the Docker Engine – Community.

Update the local package index to the latest changes in the repositories using the command:

sudo apt-get update

Install packages to allow apt to use the repository on top of HTTPS using the command:

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Now add the official GPG Docker key using the command:

curl -fsSL | sudo apt-key add -

Next, you need to make sure that the key with the contents of “9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88” was added.

To do this, search for the last 8 characters of the key contents using the command:

sudo apt-key fingerprint 0EBFCD88

Now you can connect the Docker repository using the command:

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

Update the local package index to the latest changes in the repositories using the command:

sudo apt-get update

Now you can install the latest version of Docker Engine – Community and containerd using the command:

sudo apt-get install -y docker-ce docker-ce-cli

Containerd used to be part of Docker, but today it is a standalone solution that implements an executable environment for running containers.

Now you need to make sure that the Docker Engine – Community is installed correctly. To do this, run the command:

sudo docker run hello-world

This command loads the test image and runs it in the container. When the container starts, it will display an informational message and then complete the work.

Judging by the message received, Docker Engine – Community has been successfully installed and works correctly.

You can learn how to install Docker Compose on Ubuntu Server by reading «Installing Docker Compose on Ubuntu Server».


Hi, I’m Vladimir Mikhalev, but my friends call me Valdemar. I have a lot of experience in the design and maintenance of various information systems. On my website, you will find detailed and clear guides for setting up IT solutions. Dive into the ocean, full of positive and technology! For cooperation:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.