In this tutorial, we will learn how to install and use Docker on a Debian 10 VPS.
Docker is a free and open-source tool that uses OS-level virtualization to deliver software in packages called containers. Docker is specially designed to make it easier to create, deploy and run applications by using containers. Docker containers are lightweight and very similar to Virtual Machine, using the host OS. Containers allow you to package up an application with all required libraries and other dependencies and ship it in one package.
Docker shares the same Linux kernel and other resources as the system that they’re running on, and only require the application along with its dependencies to be packaged. This will speed up your system performance and reduces the size of the application. Docker is free, so anyone can contribute to Docker and it being open-source allows anyone to extend it and meet their own needs. The main goal for the Docker is for developers to develop the applications easily, ship them into containers, and deploy it anywhere.
Step 1: Install The Docker Engine 1. Run the Docker CE installation script. Simply run the Docker CE for Linux installation script: curl -fsSL get.docker.com sh 2. Test your Docker Install (Optional) To test your docker install run the hello-world script: docker run hello-world. If Docker is working correctly the following message will be. Docker installed with the instructions from Step 1 and Step 2 of How To Install and Use Docker on Debian 10 Note: Even though the Prerequisites give instructions for installing Docker on Debian 10, the docker commands in this article should work on other operating systems as long as Docker is installed. Installing Debian Buster Install the 64-bit version of Debian on each machine that hosts one or more of the components. To install Debian Buster: To install Debian Buster, see the Debian Installation Guide (PDF). After the system is installed, make sure that it’s up to date with the most recent security patches. I have updated the Kali Linux documentation, now you can safely add the Debian docker-ce Repository as described in this answer. And here is how to install it: Installing docker-ce on Kali Linux. Docker-ce can be installed from Docker repository using Debian buster codename. Add Docker repository to your sources.list. Printf '%s ' 'deb arch.
Table of Contents

Prerequisites:
- A VPS running Debian 10. For the purposes of this tutorial, we will use our SSD 2 Debian 10 VPS.
- Full SSH root access or a user with sudo privileges is also required.
Step 1: Log in via SSH and Update Packages
Log in to your Debian 10 VPS with SSH as the root user:
Replace “root” with a user that has sudo privileges if necessary. Additionally, replace “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port number. Next, let’s make sure that we’re on Debian 10. You can do that like this:
You should get this as the output:
Then, run the following command to make sure that all installed packages on the server are updated to their latest available versions:
Step 2: Install Docker
Before starting, you will need to install some dependencies to allow your system to access the Docker repositories over HTTPS. You can install all of them with the following command:
Once all the required dependencies are installed, download and add the Docker’s GPG key with the following command:
Next, add the Docker repository with the following command:
Finally, update the repository and install the latest version of Docker with the following command:
Once the installation has been completed, check the status of Docker with the following command:
You can also check the information about Docker with the following command:
You should get the following output:
Step 2a: Install a Specific Version of Docker
In some cases, you need to install a specific version of Docker on your system. In this case, first list the available versions of Docker by running the following command:
You should see all the available version of Docker in the following output:
Next, you can install your desired version of Docker with the following command:
You can replace the with the version you want to install as shown in the above list.
For example:

Step 4: Run the Docker Command Without Sudo
By default, you will need to run Docker command with sudo privileges. If you want to run Docker command without specifying the sudo command, then you will need to add your username to the Docker group.
You can add your username to the Docker group with the following command:
Now, log out from the server and log in again with your username to apply for the new group membership. Now, you can run any Docker command without specifying sudo with Docker.
Working with Docker
At this point, Docker is installed and running on your system. Now, we will learn how to pull an image and run the container with Docker.
First, search all the images available for the Debian operating system with the following command:
You should see all the images in the following output:
Now, download the latest version of the Debian image from the above list with the following command:
Once downloaded, you should get the following output:
You can also list the downloaded image with the following command:
You should get the following output:
Now, run a container using the latest Debian image with the following command:

You should get the shell interface of a Debian container:
Install Docker Debian Buster Pro
You can exit from the container with the following command:
You can also list your active or inactive container with the following command:
Output:
You can also start the Debian container by specifying Container ID (114ef7960999) as shown below:
Now, attach the shell interface of a Debian container with the following command:
Delete a Docker Container and Image
You can easily remove unused containers and images that consume significant disk space.
To remove the Docker container, first list all the container with the following command:
You should see the following output:
Next, if your container is running, you will need to stop the container before removing it.
You can stop the running container with the following command:
Next, remove the container with the following command:
You can also remove all stopped containers by just running the following command:

Install Docker On Debian Buster
You should see the following warning message:
Type y and hit Enter to continue:
To remove the Docker image, you will need to find the ID of the image you want to remove.
You can find the image ID with the following command:
Output:
Now, remove the image with the following command:
You should get the following output:
Note: To remove the image, you will have to remove the container first.
You can also remove all unused images at a time by just running the following command:
In the above tutorial, we have learned how to install Docker on a Debian 10 VPS. We have also learned how to pull an image, run container, start and stop the container.