Install + Configure¶
These instructions include how to install and configure Docker and its associated packages on a Debian host. As of the time of writing, the Debian version is Debian 13.
These instructions are based off the official Docker documentation12.
Let the bootstrap script do the work for you!
Don’t bother doing this manually, our Debian bootstrap script can do this for you if you’re setting up a fresh Debian server. Check the script’s README for details and instructions.
Install Docker¶
Uninstall old versions¶
Before installing Docker, remove any old versions or components with the following command:
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1)
Set up apt repository¶
Add Docker’s official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the repository to apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
Update apt with the new repository:
Install the Docker packages¶
To install the latest Docker packages, run the following command:
Make sure that Docker is running after install with:
Post-install steps¶
Set up local logging driver¶
Rather than using the default json-file logging driver that ships with Docker, switch to the local logging driver that uses the native system logs.
- Open Docker’s configuration file:
!!! note
For a fresh Docker install, the
daemon.jsonfile will likely be empty. - Paste the following contents:
- Save and close with Ctrl+X, Y to confirm, and Enter to select the save location.
- Restart Docker so it reads the new configuration file: