Prerequisites for Installing Docker on Debian 12
- Basic knowledge of the Linux command line.
- An Debian 12 server with a non-root user with
sudo
privileges. You can get affordable, and powerful Debian servers from our website, and you can check out our How to access your server using SSH guide to learn how to access your server and create asudo
user.
Updating the Package Cache and Required Packages
Start by updating the packages in the package manager cache to the latest available versions using the following command:sudo apt update
Next install a few packages that will allow us to use apt
with HTTPS
in order to add the official docker repository and get the latest version of Docker. To do this, run the following command:
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
Installing Docker
We will use the official Docker repository to install the latest version of Docker. First, add the GPG key for the official Docker repository to your Debian 12 system:curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Next add the official Docker repository to your APT sources:
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 your package index:
sudo apt update
Now, with the repository added, install the docker-ce
package, which is the Docker Community Edition package:
sudo apt install docker-ce
Once the installation finishes, check that Docker isContinue reading this article
by subscribing to our newsletter.
Subscribe nowby subscribing to our newsletter.
A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.
If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.