Install docker on Ubuntu 18.04

by Daniel Pham
Published: Updated:

This article will guide you to install Docker on Ubuntu 18.04. This is one of the popular Linux operating systems today.

You can refer to the docker website for detailed installation instructions.

Full information about the version I use in the article is below.

VERSION="18.04.4 LTS (Bionic Beaver)"
PRETTY_NAME="Ubuntu 18.04.4 LTS"

Uninstall the old version of docker

If you are using Docker for the first time, you can skip this step. What if you “receive” a computer from someone else and it has an old version of Docker installed? You should do this step.

Open terminal and type command:

sudo apt-get remove docker docker-engine containerd runc

Install docker from repository

You can download the installation package to your computer and install it manually. However, I encourage you to install through the repository. Because this method will help you update the docker version more easily.

Install docker repository

Open the terminal and type the following command:

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

Next, add the docker GPG key to your computer.

curl -fsSL | sudo apt-key add -

Finally, add the docker repository to your computer.

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

Install docker engine on ubuntu 18.04

Install docker on Ubuntu 18.04
Install docker on ubuntu 18.04.

After adding the docker repository, run the command below to update the latest package and install the docker package.

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

Once the installation is completed, you can run the command below.

sudo docker run hello-world

The above command will download a test image to the computer and run it in a container. When the container runs, it prints information to the screen and then exits.

You can check the docker version you just installed.

sudo docker --version

At this step, you have successfully installed Docker.


This article summarizes the shortest steps for you to successfully install Docker on your Ubuntu 18.04 computer. In the following articles, you will get acquainted with using the docker command line.

0 0 votes
Article Rating

You may also like

Notify of
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.



Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 – All rights reserved.

Please write sources “” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Would love your thoughts, please comment.x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.