How to Install Docker on Ubuntu 20.04

How to Install Docker on Ubuntu 20.04
Techiio-author
Written by Sagar RabidasNovember 27, 2021
6 min read
Docker
1 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWS SHARE
Techiio-author
Sagar Rabidas

Software Developer

In this blog, we will go through the process of installing Docker on Ubuntu 20.04.

Docker:-

Docker is a box-primarily based utility framework, which wraps a specific software with all its dependencies in a container. Docker containers can without difficulty to ship to the remote location on start there without making whole application setup.

The docker authentic group offers PPA for installing docker on ubuntu 20.04 using PPA. You simply need to configure docker PPA in your system before putting in docker on the ubuntu device.

This tutorial will help you to install docker on ubuntu 20.04 its focal fossa systems.

Prerequisite

Login to your Ubuntu 20.04 system with Sudo privileged user. Then run the following commands to install the required packages.

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

Step 1 – Installing Docker on Ubuntu

First of all, import the GPG key to your system to verify packages signatures before installing them. To import the key run the below command on the terminal.

After that add the Docker repository on your Ubuntu system which contains Docker packages including its dependencies. You must have to enable this repository to install Docker on Ubuntu.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add 
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" 

Your system is now ready for Docker installation. Next, execute the following commands to upgrade the apt index and then install Docker on Ubuntu 20.04 Linux system.

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

After successful installation of the Docker community edition, the service will start automatically, Use the below command to verify service status.

Your system is now ready for running Docker containers.

Step 2 – Manage Docker Service

As usual Docker service is also managed under the Systemd daemon. You can use system commands to stop, start or view the status of the Docker service.

Run the below command to view service status:

sudo systemctl status docker 
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-06-17 16:41:20 UTC; 1min 58s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 926989 (dockerd)
      Tasks: 8
     Memory: 35.7M
     CGroup: /system.slice/docker.service
             └─926989 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Jun 17 16:41:20 tecadmin systemd[1]: Started Docker Application Container Engine.
Jun 17 16:41:20 tecadmin dockerd[926989]: time="2020-06-17T16:41:20.247640882Z" level=info msg="API listen on /run/docker.sock"

Use the below command to stop, start or restart the Docker service:

sudo systemctl stop docker 
sudo systemctl start docker 
sudo systemctl restart docker 

Step 3 – Run Docker Hello World

You have successfully installed Docker on the Ubuntu system. The Docker engine service is also running fine. Next, run a hello world example to verify that everything is fine.

To run Docker hello world example, open a terminal and type:

sudo docker run hello-world 

You will see the results below. It means Docker is properly configured on your system.

blogpost

Step 4 – Install Docker Compose

Download the latest version of the Docker Composed tool from Github. Use the below commands to download and install Docker compose 1.26.0. Before installing make sure compatibility with your docker version.

curl -L https://github.com/docker/compose/releases/download/1.26.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 
chmod +x /usr/local/bin/docker-compose 

Conclusion

Now, you have successfully installed Docker on Ubuntu 20.04 system using PPA. Additionally, you also have configured Docker-compose in your system.

docker
devops
installance docker
ubuntu
1 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance