6 Docker Setup
Fr4nz D13trich edited this page 2025-10-02 18:36:25 +02:00

Dependencies & Repo

  1. Install the required dependencies with the following apt command:
sudo apt install ca-certificates curl gnupg lsb-release
  1. Create key directory --if-not-exists
sudo mkdir -p /etc/apt/keyrings
  1. Download and add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  1. Add Docker's APT repository with:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  1. Update the package list:
sudo apt update

Install & Setup

  1. Install essential Docker packages with:
sudo apt install docker-ce docker-ce-cli containerd.io
  1. Add the user to the Docker group with:
sudo usermod -aG docker $USER
  1. Logout and back in or reboot host machine

Test Docker

To confirm Docker is running correctly, test the setup with a simple container. Run the "hello-world" container with the following docker run command:

docker run hello-world

Uninstall Docker

  1. Use the apt purge command to uninstall the Docker-related packages:
sudo apt purge docker-ce docker-ce-cli containerd.io
  1. To delete leftover data, run the following command:
sudo rm -rf /var/lib/docker