Installing Docker in Debian 9

Instructions for installing Docker Community Edition (CE) in Debian 9

Docker is a software for automating the deployment and management of applications in an operating system-level virtualization environment. It allows you to package an application with all its environment and dependencies into a container that can be ported to any Linux system with kernel cgroups support and provides a container management environment

file

Before installing Docker, update the existing Debian package list: ``.shell sudo apt update

Next, let's install the necessary packages that allow **apt** to use packages over HTTPS:
``.shell
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Add the GPG key of the official Docker repository to your system: ``.shell curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Add Docker repository to the list of APT package sources:
``.shell
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

Then update the package database with information about Docker packages from the newly added repository: ``.shell sudo apt update

To make sure to install Docker from the Docker repository and not from the default Ubuntu repository, run the command:
``.shell
apt-cache policy docker-ce

``.shell root@kvmde67-19464:~# apt-cache policy docker-ce docker-ce: Installed: (none) Candidate: 5:19.03.8~3-0~debian-stretch Version table: 5:19.03.8~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.7~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.6~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.5~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.4~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.3~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.2~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.1~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:19.03.0~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.9~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.8~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.7~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.6~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.5~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.4~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.3~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.2~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.1~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 5:18.09.0~3-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.06.3~ce~3-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.06.2~ce~3-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.06.1~ce~3-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.06.0~ce~3-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.03.1~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 18.03.0~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.12.1~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.12.0~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.09.1~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.09.0~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.06.2~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.06.1~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.06.0~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.3~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.2~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.1~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.0~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages

This does not install **docker-ce**, but will use the Docker repository for Debian 9 (Stretch) to install it.

Installing Docker:
``.shell
sudo apt install docker-ce

Docker is installed, the process will start at system startup.

Let's check that the process is running: ``.shell sudo systemctl status docker

``.shell
root@kvmde67-19464:~# sudo systemctl status docker
Docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled
   Active: active (running) since Wed 2020-05-06 15:15:44 MSK; 2min 51s ago
     Docs: https://docs.docker.com
 Main PID: 6594 (dockerd)
   CGroup: /system.slice/docker.service
           └─6594 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.so

May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44.4160
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44.4167
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44:4173
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44:4182
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44.6000
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44.7043
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44:8040
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44:8067
May 06 15:15:44 kvmde67-19464.fornex.org systemd[1]: Started Docker Application Contai
May 06 15:15:44 kvmde67-19464.fornex.org dockerd[6594]: time="2020-05-06T15:15:44.8603

When we install Docker, we get not only the Docker service, but also the docker command line utility or the Docker client.


You can also use our One-Click-Apps for one-click installation to install Docker To do so, select the required [VPS] plan(https://fornex.com/ssd-vps) and choose Applications → Docker, to install. Please note that this will install Docker on Ubuntu 18.04.

file


If you have any configuration difficulties or have additional questions, you can always contact our support team via ticket system.

Need help?Our engineers will help you free of charge with any question in minutesContact us