Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Debian 11 - Install Docker

Related Posts

Steps

Run the following script to install docker on Debian 11.

For now, this is exactly the same as the script for installing on Debian 10, I just duplicated the post for reassurance, and if anything changes, I can change the relevant post.

#!/bin/bash

# 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 -y \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg-agent \
  software-properties-common

# Add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

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

# Install docker  
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

# Add yourself to the docker group so you can run docker commands
# without sudo
sudo adduser $USER docker

At the time of writing this post, this resulted in installing Docker version 20.10.8, build 3967b7d.

References

Last updated: 26th June 2023
First published: 20th August 2021