Install Docker on Debian 12 (Bookworm)
Step1: Install some necessary packages.
apt update
apt upgrade -y
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates
Step2: Set up Docker’s apt repository.
curl -sSL https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://download.docker.com/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list
Step3: Install the Docker packages.
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Step4: Verify that the installation is successful.
docker version