Skip to content

Latest commit

 

History

History
70 lines (61 loc) · 1.97 KB

install_docker_on_ubuntu.md

File metadata and controls

70 lines (61 loc) · 1.97 KB

Installation of Docker on Ubuntu

Prerequisites

OS requirements

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.

Uninstall old versions

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

Install using the repository

Set up the repository
  1. 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
  1. 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
  1. 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
  1. 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
  1. Start the Docker service
sudo systemctl start docker

or

sudo service docker start
  1. Enable docker service to start on startup.
sudo  systemctl enable docker
  1. Verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world

Install On Other Platforms