How to install Docker?

Docker can be used for free in a developers laptop. Docker software is available on a community edition, where developers can setup a host and start containerizing the jobs.

There is enterprise edition, with more bells and whistles.

Before we get started on the installation process, here is a piece of code that removes any existing docker related files (in case, there was an earlier attempt to install)

sudo apt-get remove docker docker-engine docker.io containerd runc

Followed by

sudo apt-get update

To obtain community edition, first open your terminal and enter the following:

cat /etc/release

Note the OS type, versions and other details.

Now, visit docker website and get docker community edition.

Also, one can add the repository to their package manager, by:

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

Add the docker software to apt package manager

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Once again, update the package index by:

sudo apt-get update

Followed by,

sudo apt-get install docker-ce docker-ce-cli containerd.io

Check if the docker is running

sudo systemctl status docker

Leave a comment