To install Docker Engine, one of these Ubuntu 64-bit version need:
- Ubuntu Hirsute 21.04
- Ubuntu Groovy 20.10
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Bionic 18.04 (LTS)
- Ubuntu Xenial 16.04 (LTS)
Docker Engine is supported on x86_64
(or amd64
), armhf
, and arm64
architectures.
Older versions of Docker were called docker
, docker.io
, or docker-engine
. If these are installed, uninstall them:
sudo apt-get remove docker docker-engine docker.io containerd runc
- Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
- Add Docker’s official GPG key:
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- Use the following command to set up the stable repository.
sudo echo \
"deb [arch=amd64 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
- Update
apt
package index, and install the latest version of Docker Engine.
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Start the Docker service
sudo systemctl start docker
or
sudo service docker start
- Enable
docker
service to start on startup.
sudo systemctl enable docker
- Verify that Docker Engine is installed correctly by running the
hello-world
image.
sudo docker run hello-world