Install Docker on Ubuntu
How do I install Docker on Ubuntu?
1 min readFeb 14, 2021
Sure. You can read through the Docker documentation to find out how to Docker on Ubuntu. Or… You can just copy-paste the commands below.
Uninstall old versions of Docker
sudo apt-get remove docker docker-engine docker.io containerd runc
Add the Docker apt repository
sudo apt-get updatesudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-commoncurl -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 \
$(lsb_release -cs) \
stable"
Install Docker Engine
sudo apt-get updatesudo apt-get install docker-ce docker-ce-cli containerd.io
Manage Docker as a non-root user
There is courage. There is temperance. Laches and Charmides. For the courageous folks, follow the Post-installation steps for Linux.
sudo groupadd dockersudo usermod -aG docker $USERnewgrp docker
Reboot to make sure the new permissions stick.
sudo reboot
Verify that Docker Engine is installed correctly
docker run hello-world