How to install docker on debian 10 /11 ( buster / bullseye )

5
(2)

Docker is a container-based application framework, which wraps a specific application with all its dependencies in a container. Docker containers can easily to ship to the remote location on start there without making entire application setup. This tutorial will help you to install Docker on Debian 10 Buster Linux distribution.
Step 1 – Prerequisites
First of all, remove any default Docker packages from the system before installation Docker on a Linux VPS. Execute commands to remove unnecessary Docker versions.

 sudo apt-get purge docker lxc-docker docker-engine docker.io


Now, install some required packages on your system for installing Docker on Debian system. Run the below commands to do this:

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

Step 2 – Setup Docker PPA
After that, you need to import dockers official GPG key to verify packages signature before installing them with apt-get. Run the below command on terminal.

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

After that add the Docker repository on your Debian system which contains Docker packages including its dependencies. You must have to enable this repository to install Docker on Debian.

Debian 10 buster

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable"

Debian 11 bullseye

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable"

Step 3 – Install Docker on Debian 10
Your system is now ready for Docker installation. Run the following commands to upgrade apt index and then install Docker community edition on Debian.

sudo apt-get update
 sudo apt-get install docker-ce


After successful installation of Docker community edition, the service will start automatically, Use below command to verify service status.
sudo systemctl status docker
Your system is now ready for running Docker containers. Use our Docker Tutorial for Beginners to working with Docker.
Step 4 – How to Use Docker
After installation of Docker on a Linux. Here are some basic details for search and download Docker images, launch containers and manage them.
Search Docker Images

docker search debian


Download Docker Images

 docker pull debian


Now make sure that the above images have been downloaded successfully on your system. Below command list all images.
docker images

REPOSITORY    TAG          IMAGE ID            CREATED         SIZE
 debian        latest       3bbb526d2608        4 weeks ago     101MB


Launch New Container with Image

docker run -i -t debian /bin/bash


To exit from docker container type CTRL + P + Q. This will leave container running in the background an provide you host system console. If you used the exit command, it will stop the current container.
After exiting from Docker container, execute below command to list all running containers.

Similar Posts:

1,783

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

Scroll to Top