How to Install Docker on Debian Latest
Docker is an open-source platform that provides a standardized packaging format for containerized applications. It is used to build, ship and run distributed applications. In this tutorial, I will guide you on how to install Docker on Debian latest release.
Prerequisites
Before you start with the installation process, make sure you have the following prerequisites:
- A Debian 10 or Debian 11 system running
- User account with sudo privileges
- Internet connectivity
Step 1: Update the System
Before we start installing any packages or software, we need to ensure that the system is up to date. Use the following command to update your Debian system:
sudo apt update
sudo apt upgrade -y
Step 2: Install Dependencies
Docker requires some dependencies to run correctly. Execute the following command to install required dependencies:
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
This command will install apt-transport-https, ca-certificates, curl, gnupg, and lsb-release, which are essential for the installation of Docker.
Step 3: Add Docker GPG Key
The Docker package is signed with a GPG key, and we need to add this key to our system. Use the following command to download and add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Step 4: Add Docker Repository
After adding the Docker GPG key, we need to add Docker’s official repository to our Debian system. Use the following command to add the Docker repository:
echo "deb [arch=amd64 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
This command will add the Docker repository to your Debian system.
Step 5: Install Docker
Once the Docker repository has been added, run the following command to install the latest version of Docker on your Debian system:
sudo apt update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
This command will install the latest version of Docker on your Debian system.
Step 6: Verify Docker Installation
After installing Docker, you need to verify if it’s properly installed on your Debian system. Run the following command:
sudo docker version
This command will display the installed version of Docker on your Debian system.
Conclusion
In this tutorial, you learned how to install Docker on Debian latest release. You also verified the installation by using the docker version command. Now you can start using Docker and create containers for testing or production environments.