OneBite.Dev - Coding blog in a bite size

install docker on debian

Simple docker step by step how to install docker on debian with explanation

Docker, a containerization platform, can be very useful for creating, deploying, and running applications. This step-by-step guide will provide instructions on how to install Docker on a Debian system.

Preliminary Steps

Before starting the Docker installation process, ensure that your Debian system is up-to-date by running the following command:

sudo apt-get update

Next, install the necessary packages that will allow apt command to be used over HTTPS:

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Import Docker’s official GPG key

For security, it’s important to verify package integrity. Import Docker’s official GPG key with the following command:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Set up Stable Repository

To correlate your Debian version with Docker’s repository, utilize this command:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

Remember to update the apt package list so it uses the newly added Docker repository:

sudo apt-get update

Installation of Docker Engine

You’re now ready to finally install Docker. Do this with the following command:

sudo apt-get install docker-ce docker-ce-cli containerd.io

Verify Docker Installation

To ensure Docker has been installed successfully and is running correctly, run the Docker hello-world image:

sudo docker run hello-world

If Docker is working properly, it will download the ‘hello-world’ image and run a container from it. This will display a welcome message confirming that Docker is functioning as expected.

In conclusion, by following these steps, any beginner should be able to successfully install Docker on a Debian system. Once installed, Docker enhances the efficiency of using, building and sharing applications in any environment.

docker