Learn how to install Docker on Ubuntu.
Here are the steps.
(A) Set up the repository
1) Update the apt package index
sudo apt-get update
2) Install packages to allow apt to use a repository over HTTPS
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
3) Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4) Set up the stable repository
echo \
“deb [arch=$(dpkg –print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
(B) Install Docker Engine
1) Update the apt package
sudo apt-get update
2) Install the latest version of Docker Engine and containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io
Verification
1) Verify if the docker engine is properly install.
sudo docker run hello-world
Reference