Introduction
Docker is used for creating, deploying, and managing containers for application development. It uses OS virtualization to isolate containers and allow them to communicate with each other.
In this tutorial, you will learn how to install Docker on Debian 10.
Prerequisites
- Debian 10 installed and configured
- Access to a command line/terminal window
- A user account with sudo privileges
Docker on Debian 10
To set up Docker, you will need to prepare the system for installation. Deleting older versions of Docker packages and downloading the required dependencies speeds up the process.
Step 1: Uninstall Default Docker Packages
The first step is to remove old versions of docker
, docker.io
, and docker-engine
that may already be on the system. These versions are not required for the latest stable release of Docker.
Delete the outdated packages by typing the following command in the terminal:
sudo apt-get purge docker lxc-docker docker-engine docker.io
Step 2: Install Required Packages
Update the default repository with the command:
sudo apt-get update
Download the following dependencies:
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
By doing so, this allows you to add a new repository over HTTPS.
Step 3: Install Docker
There are several ways to install Docker:
- The standard and most practical approach is to set up Docker repositories and install the software from them.
- Alternatively, download the DEB package and install Docker manually. This method is recommended for users that have air-gapped systems with no access to the internet.
- If you have Raspbian, the only way to set up Docker is by using automated convenience scripts.
Method 1: Install Docker Using the Repository on Debian 10
The best option for most Debian 10 users will be to install Docker from its official repositories. To do so, follow the steps outlined below.
1. Download Docker’s official GPG key to verify the integrity of packages before installing:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
2. Add the Docker repository to your system repository with the following command:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable"
3. Update the apt repository:
sudo apt-get update
4. Install Docker Engine – Community (the latest version of Docker) and containerd
:
sudo apt-get install docker-ce docker-ce-cli containerd.io
5. The service will start automatically after the installation. Check the status by typing:
sudo systemctl status docker
6. You can also verify the installation by asking for the Docker version:
docker -v
0 comments:
Post a Comment