Skip to content
Luke Le edited this page Aug 22, 2024 · 5 revisions

prerequisites

The setup guide will use Docker and Docker Compose, which typically comes separate from Docker. Docker operates similarly to virtual machines but runs containers that share the host operating system and virtualize only at the software level. This approach offers advantages in portability and security. Details on its benefits, however, will be kept minimal in this guide. Personally, I elected to use Docker as means for practicing with the application.

installing docker on Debian 12

Docker is available in the official Debian repositories and can be installed using APT. However, this version may not always be the latest. For the most up-to-date version, it's preferable to download Docker directly from the official repository.

Step 1: Update the package index and install prerequisites

These prerequisites are necessary to add and use a new HTTPS repository, specifically the Docker repository.

$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl gnupg

Step 2: Import the GPG repository key

This ensures the authenticity of the Docker software.

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg

Step 3: Add the Docker repository

Add the Docker repository to the system and refresh the package list.

$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt update

Step 4: Install Docker

Finally, install Docker with the following command:

$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  • docker-ce: The Docker engine itself.
  • docker-ce-cli: A command-line tool for interacting with the Docker daemon.
  • containerd.io: A container runtime that manages the lifecycle of containers.
  • docker-buildx-plugin: A CLI plugin that extends Docker build capabilities with additional features.
  • docker-compose-plugin: A CLI plugin for Docker Compose.

install docker compose

$ sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose