published: 12th of December 2020
Docker and docker-compose are a very common tools for developing and deploying applications.
In this post I will cover the process of installing Docker engine and Docker compose on Debian 10 minimal.
Ensure that there are no default versions of Docker install. There should not be, but it's worth confirming.
apt list --installed | egrep "(docker|container)"
Add the required APT repositories.
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Add the GPG key.
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Verify the GPG key matches the key listed in the docks.
sudo apt-key fingerprint 0EBFCD88
# Output
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb)
sub 4096R/F273FCD8 2017-02-22
Add the required APT repositories.
sudo add-apt-repository -y \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
Install Docker, the CLI tools and containerd.
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
Confirm the docker service is started and enabled.
systemctl enable docker
# Output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-12-12 06:07:54 AEST; 6min ago
Docs: https://docs.docker.com
Main PID: 4750 (dockerd)
Tasks: 10
Memory: 48.1M
CGroup: /system.slice/docker.service
└─4750 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Add your user to docker group.
sudo usermod -aG docker $USER
Now logout and log back in or run the newgrp docker command.
Confirm that you can run docker commands.
docker pull hello-world
# Output
Using default tag: latest
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
Install the docker-compose binary from the Github release page.
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Make the docker-compose binary executable.
sudo chmod +x /usr/local/bin/docker-compose
Symlink the docker-compose binary into a location in your $PATH .
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Update the docker-compose binaries permissions.
sudo chgrp docker /usr/local/bin/docker-compose
sudo chmod 750 /usr/local/bin/docker-compose
Confirm that you can run docker-compose commands.
docker-compose --version
# Output
docker-compose version 1.27.4, build 40524192
This post covered the process of installing Docker engine and Docker compose on Debian 10 Minimal.
https://docs.docker.com/engine/install/debian/