Unlock the Power of Docker: Easy Step-by-Step Installation Guide for Ubuntu Users!
The first thing we should do once we logged into Ubuntu machine, is updating the machine with following command:
sudo apt-get update -y
Now we need to set the GPG key. this entire below command fetches the Docker GPG key using curl
and then adds it to the system’s keyring using apt-key
.
The GPG key is essential for verifying the authenticity of Docker packages during installation:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Now is the time to install the software-properties-common Package. To obtain the add-apt-repository command, you need to install the software-properties-common.
sudo apt install software-properties-common
The add-apt-repository command isn’t like typical packages you install with apt on Ubuntu LTS / Debian. Instead, it’s part of the software-properties-common package.
Now it's time to add the docker apt repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the machine again to ensure all needed packages were in place.
Now all prerequisites were set and it's time to install the Docker with below line command
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
You have successfully installed the Docker in Ubuntu distributions, and this can be verified with following command
docker --version
Now it’s time to see the service is up and running in the VM by verifying from executing the below command:
sudo service docker status
The above output will show that the service is running. Press Ctrl+C to come out of the output mode to the prompt mode.
Note: In case if you want to install the basic text editor like nano , try executing the below command to use the editor for writing files in the Ubuntu distributions
sudo apt-get install nano -y
That’s it, thank you for reading.
Happy to share this article to help you to explore new updates, do follow me in medium.com, click the clap 👏 button below to show your valuable support.