Install Docker on Ubuntu

How do I install Docker on Ubuntu?

Mike Vincent
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-common
curl -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

“That’s all Folks!”

--

--

Mike Vincent
Mike Vincent

Written by Mike Vincent

Mike Vincent is an American software engineer and writer based in Los Angeles. He writes about tech leadership and holds degrees in Linguistics and Management.

No responses yet