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

docker0

Add GPG key for official docker repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

docker1-1.png

 

Add the Docker repository to apt

sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable”

docker2

Update package lists, etc.

sudo apt update

docker3

apt-cache policy docker-ce

docker4

Install Docker

sudo apt install docker-ce

docker5

Check if Docker service is running

sudo systemctl status docker

docker6

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>

docker7

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

 

docker9

 

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!

 

 

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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