Hello Readers and welcome back to the Docker Series. In today's blog we are going to discuss on how to install docker on Linux server. I've Ubuntu VM deployed in my environment and we are going to install the docker on the same.
So without any further delay, let's get started.
1. In this lab, I'm going to use Ubuntu 22.04
2. First step is the update the existing packages.
sudo apt update
3. Next, install a few prerequisite packages which let apt use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
4. Then add the GPG key for the official Docker repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
5. Add the Docker repository to APT sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
6. Update your existing list of packages again for the addition to be recognized:
sudo apt update
7. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce
8. Then install Docker:
sudo apt install docker-ce
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
sudo systemctl status docker
The output should be similar to the following, showing that the service is active and running:
That's it for now.
We will explore Docker in more detail in upcoming blogs.
Thank you for reading!
*** Explore | Share | Grow ***
Comments