Install Docker in Ubuntu 18.04

What is Docker?

“Docker is used to run software packages called “containers”. Containers are isolated from each other and bundle their own application[8], tools, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating system kernel and are thus more lightweight than virtual machines. Containers are created from “images” that specify their precise contents. Images are often created by combining and modifying standard images downloaded from public repositories.”  –Wikipedia

Below is a quick introductory video about Docker

Installing Docker

Update System

sudo apt update

sudo apt upgrade

Install packages which let apt use packages over https

sudo apt install apt-transport-https ca-certificates curl software-properties-common


Add GPG key for official docker repository

curl -fsSL | sudo apt-key add –



Add the Docker repository to apt

sudo add-apt-repository “deb [arch=amd64] bionic stable”


Update package lists, etc.

sudo apt update


apt-cache policy docker-ce


Install Docker

sudo apt install docker-ce


Check if Docker service is running

sudo systemctl status docker


hit “q” to exit.

If docker service is not running, start it on boot by using the following command

sudo systemctl enable docker

Again check docker’s service status. And see if docker service is running.

Now, Docker is successfully installed. But by default, docker needs root privileges to run. i.e. we need to use sudo for executing every docker command. To avoid this, add your username to docker group.

sudo usermod -aG docker <username>


To apply for the new group membership, log out and log back into the system.

Confirm if your user is added to the group

id -nG




I hope this tutorial has helped you install Docker in Ubuntu 18.04. If you have any doubts, find any grammatical errors, or want to request any tutorial, feel free to make use of comments section. Thanks for reading!





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s