how to Install Docker CE and Docker Compose on Debian 10 / 11

0
(0)

How do I install Docker CE on Debian 11/10?, How can I install Docker Compose on Debian 11/10 Linux system?. In this guide, I’ll discuss a step by step installation of Docker and Docker Compose on Debian 11/10.

Step 1: Install Dependency packages

Start the installation by ensuring that all the packages used by docker as dependencies are installed.

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Step 3: Add the Docker repository to Debian 10 / Debian 11

Add Docker repository which contain the latest stable releases of Docker CE.

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"

This command will add the line shown in /etc/apt/sources.list file.

deb [arch=amd64] https://download.docker.com/linux/debian buster stable

Step 4: Install Docker & Docker Compose on Debian 11/10

Update the apt package index.

sudo apt update

To install Docker CE on Debian, run the command:

sudo apt -y install docker-ce docker-ce-cli containerd.io

Check installation:

$ docker version

Output like:

[email protected]:~# docker version
Client: Docker Engine - Community
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        dea9396
 Built:             Thu Nov 18 00:37:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:35:39 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Install latest docker-compose

curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url  | grep docker-compose-linux-x86_64 | cut -d '"' -f 4 | wget -qi -

Make the binary file executable.

chmod +x docker-compose-linux-x86_64

Move the file to your PATH.

sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose

Confirm version.

$ docker-compose version
Docker Compose version v2.1.1

Add user to docker group:

sudo usermod -aG docker $USER
newgrp docker

That’s all.

Similar Posts:

167

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Scroll to Top