How to install Docker in Ubuntu 20.04 Desktop/Laptop

Docker community version available for Docker archive. In this demo, we will see,

  • Installing docker in Ubuntu 20.04
  • Start docker service
  • Enable docker daemon to start automatically across reboots
  • Test docker installation

Installing docker in Ubuntu 20.04

You can install docker in Ubuntu 20.04 version using apt, as follows,

sudo apt install

A detailed example of docker installation:

[email protected]:~$ sudo apt install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  bridge-utils cgroupfs-mount containerd pigz runc ubuntu-fan
Suggested packages:
  aufs-tools btrfs-progs debootstrap docker-doc rinse zfs-fuse | zfsutils
The following NEW packages will be installed:
  bridge-utils cgroupfs-mount containerd pigz runc ubuntu-fan
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 69.3 MB of archives.
After this operation, 333 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 focal/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 focal/main amd64 bridge-utils amd64 1.6-2ubuntu1 [30.5 kB]
Get:3 focal/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:4 focal/main amd64 runc amd64 1.0.0~rc10-0ubuntu1 [2,549 kB]
Get:5 focal/main amd64 containerd amd64 1.3.3-0ubuntu2 [27.8 MB]
Get:6 focal-updates/universe amd64 amd64 19.03.8-0ubuntu1.20.04 [38.9 MB]
Get:7 focal/main amd64 ubuntu-fan all 0.12.13 [34.5 kB]
Fetched 69.3 MB in 20s (3,476 kB/s)                                           
Preconfiguring packages ...
Selecting previously unselected package pigz.
(Reading database ... 223903 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package bridge-utils.
Preparing to unpack .../1-bridge-utils_1.6-2ubuntu1_amd64.deb ...
Unpacking bridge-utils (1.6-2ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package runc.
Preparing to unpack .../3-runc_1.0.0~rc10-0ubuntu1_amd64.deb ...
Unpacking runc (1.0.0~rc10-0ubuntu1) ...
Selecting previously unselected package containerd.
Preparing to unpack .../4-containerd_1.3.3-0ubuntu2_amd64.deb ...
Unpacking containerd (1.3.3-0ubuntu2) ...
Selecting previously unselected package
Preparing to unpack .../5-docker.io_19.03.8-0ubuntu1.20.04_amd64.deb ...
Unpacking (19.03.8-0ubuntu1.20.04) ...
Selecting previously unselected package ubuntu-fan.
Preparing to unpack .../6-ubuntu-fan_0.12.13_all.deb ...
Unpacking ubuntu-fan (0.12.13) ...
Setting up runc (1.0.0~rc10-0ubuntu1) ...
Setting up bridge-utils (1.6-2ubuntu1) ...
Setting up pigz (2.4-1) ...
Setting up cgroupfs-mount (1.4) ...
Setting up containerd (1.3.3-0ubuntu2) ...
Created symlink /etc/systemd/system/ →
Setting up ubuntu-fan (0.12.13) ...
Created symlink /etc/systemd/system/ →
Setting up (19.03.8-0ubuntu1.20.04) ...
Adding group `docker' (GID 136) ...
Created symlink /etc/systemd/system/ → /lib/sy
docker.service is a disabled or a static unit, not starting it.
Processing triggers for systemd (245.4-4ubuntu3.2) ...
Processing triggers for man-db (2.9.1-1) ...
[email protected]:~$

Start Docker service and enable docker daemon upon reboot,

sudo systemctl start docker
sudo systemctl enable docker


[email protected]:~$ sudo systemctl start docker
[email protected]:~$ sudo systemctl enable docker
Created symlink /etc/systemd/system/ → /lib/systemd/system/docker.service.
[email protected]:~$

Testing your docker installation

[email protected]ryout:~$ docker --version
Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.1