Installing Docker in docker-container running Ubuntu 20.04

aditya goel
2 min readJan 20, 2022

Step #1.) Let’s first check, which version of Ubuntu right now we have :-

cat /etc/lsb-release

Step #2.) Next, let’s update with following commands :-

sudo apt-get update

sudo apt-get install \
ca-certificates \
curl \
gnupg \

Step #3.) Next, add Docker’s official GPG key:

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step #4.) Next, use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step #4.) Next, Install Docker Engine. Update the apt package index, and install the latest version of Docker Engine and containerd :-

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli \

Step #6.) Next, test the docker version :-

docker --version

That’s all in this section. If you liked reading this blog, kindly do press on clap button multiple times, to indicate your appreciation. We would see you in next series.

References :-