setup/doc/docker.md

1.6 KiB
Raw Permalink Blame History

Setup Docker

General

  • update your APT cache using
sudo apt update
  • uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
  • install basic package dependencies
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release --no-install-recommends
  • add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  • set up the stable repository
echo "deb [arch=$(dpkg --print-architecture) 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
  • update the package index and install the latest version
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
  • check whether the service is enabled
systemctl is-enabled docker
systemctl is-enabled containerd
  • check Docker and Containerd service status
systemctl status docker containerd
  • verify Docker version
docker -v
  • add the user to the group docker
sudo usermod -aG docker <user>
  • log in as user using the command below and verify the configuration
su - <user>
  • run the following docker command to verify your installation
docker run hello-world

How to Install Docker on Debian 11

How to Install Docker on Debian 11