In this article, we will have explained the necessary steps to install and configure Docker on Debian 9. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Docker is a free and open-source containerization platform that allows you to quickly build, test and deploy applications as portable, self-sufficient containers that can virtually run everywhere. The containers are similar to a virtual machine but consume fewer resource, easy to manage and can run anywhere regardless of operating environment it is running in.
Install Docker on Debian
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
Step 2. Install Docker on Debian 9.
Now, import the repository’s GPG key using the following curl command:
curl-fsSLhttps://download.docker.com/linux/debian/gpg | sudo apt-key add -
Add the Docker APT repository to your system’s software repository list by typing:
sudoadd-apt-repository"deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
You can simply install the Docker package using following command:
Once the installation is completed the Docker service will start automatically:
The output should be similar to the following, showing that the service is active and running:
To verify that Docker is installed, run the following command:
Congratulation, you have learned how to install and configure Docker on Debian 9 Stretch. If you have any question, please leave a comment below.