How to Install Docker in Ubuntu 20.04

Docker is an open-source containerization platform that allows you to quickly build, test, and deploy applications as portable containers that can run virtually anywhere. Installing Docker in Ubuntu is fairly straightforward. We’ll enable the Docker repository, import the repository GPG key, and install the package. Just follow the steps below:

Step 1: Update the packages index and install the dependencies necessary to add a new HTTPS repository :

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

Step 2: Import the repository’s GPG key using the following curl command:

$ curl -fsSL | sudo apt-key add -

Step 3: Add the Docker APT repository to your system:

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

Step 4: To install the latest version of Docker, run the commands below.

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

Once the installation is completed, the Docker service will start automatically. You can verify it by typing:

$ sudo systemctl status docker

If the result is somewhat similar to the presented image, you successfully install docker in your ubuntu.

Leave a Comment

Your email address will not be published. Required fields are marked *