Introduction
Docker is an open-source platform that enables developers to build, deploy, run, update and manage containers and uses OS-level virtualization to deliver software in packages called containers. Docker is a tool used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments. The software that hosts the containers is called Docker Engine.
In this article, we will explain two ways to install Docker on Ubuntu 20.04.
- From the official Docker repository.
- From the default Ubuntu repositories.
I. Installing Docker from the Official Repository
-
Update the package index.
$ sudo apt update
-
Install prerequisite packages.
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
-
Download the GPG Key and add the key to your system.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
-
Add the docker repository by running the following command.
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
- Install Docker.
$ sudo apt install docker-ce -y
- Verify the docker status.
$ sudo systemctl status docker
Output
II. Installing Docker from default Ubuntu repositories
-
Update the package index.
$ sudo apt update
- Install the docker by running the following command.
$ sudo apt install docker.io -y
- Refresh the snap package.
$ sudo snap refresh
- Install the docker dependencies.
$ sudo snap install docker
- Verifying the docker version.
$ docker --version
Output
Docker version 1.13.1, build 7d71120/1.13.1