Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Update the current package list:

    Code Block
    languagebash
    sudo apt update
  2. Install the packages that allow APT to use HTTPS:

    Code Block
    languagebash
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  3. Add the CFG key of the official Docker repository to the system:

    Code Block
    languagebash
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    Info
    titleNote

    When installing on Debian 12, this command will look like this:

    Code Block
    languagebash
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  4. Add the Docker repository to the list of the APT package sources:

    Code Block
    languagebash
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
    Info
    titleNote

    When installing on Debian 12, this command will look like this:

    Code Block
    languagebash
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  5. Update the current package list including the Docker packages from the added repository:

    Code Block
    languagebash
    sudo apt update
  6. Make sure the installation is performed from the Docker repository:

    Code Block
    languagebash
    apt-cache policy docker-ce
    Response example:
    Code Block
    languagebash
    docker-ce:
      Installed: (none)
      Candidate: 18.03.1~ce~3-0~ubuntu
      Version table:
         18.03.1~ce~3-0~ubuntu 500
            500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
  7. Install the Docker:

    Code Block
    languagebash
    sudo apt install docker-ce

    Info
    titleNote

    When installing on Debian 12, this command will look like this:

    Code Block
    languagebash
    sudo apt install docker-ce docker-ce-cli containerd.io

     

  8. Make sure the Docker is running:

    Code Block
    languagebash
    sudo systemctl status docker
    The response must contain the active (running) status:
    Code Block
    languagebash
    docker.service - Docker Application Container Engine
       Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
       Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
         Docs: https://docs.docker.com
     Main PID: 10096 (dockerd)
        Tasks: 16
       CGroup: /system.slice/docker.service
               ├─10096 /usr/bin/dockerd -H fd://
               └─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml

...