Install dependencies necessary to add a new HTTPS repository.
sudo apt 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"
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io
NOTE: This will install the latest version of Docker.
sudo apt update apt list -a docker-ce
sudo apt install docker-ce=<VERSION> docker-ce-cli=<VERSION> containerd.io
NOTE: Docker will be automatically updated through standard:
sudo apt update sudo apt upgrade
sudo apt-mark hold docker-ce
sudo systemctl status docker
Non-Root User
sudo usermod -aG docker $USER
NOTE: By default, only root and user with sudo privileges can execute Docker commands.
docker container run hello-world
NOTE: This should display Hello from Docker.