Table of Contents

How to Install Docker on Ubuntu Linux

Hello friends, in this post we are going to learn how to install Docker on Ubuntu operating system. This guide will be very clear and simple for newbies as well as Linux expertise. I will try to show you the best and easy method with simple steps. So, let’s see what is Docker its prerequisites and steps to install

What is Docker ?

Whenever a product is designed the first and the only goal of the product should run smoothly in a production environment. The Developer test the product on UAT or Pre-Production environment before sending on Live or Production environment that can be two, four or any number of servers depends on production users volume. Whenever a developer develops a product that works absolutely fine on the Developer’s machine but as soon as that project moves on production environment that case the project usually fails to work with the same performance that was tested on UAT or Pre-Production environment.

For example, whenever you develop any website using PHP, JAVA, or .NET and whenever you move that project on the webserver maybe you will face some uncertainty like some glitches, images not loading, path issues, etc.

Docker is just completely a different thing and it’s compatible with almost any type of programming language or any project. Docker allows you a container and these types of containers absolute heart of the Docker. These containers wrap up your entire code and this will work fine as it was running on UAT or Pre-Production environment. Wherever you are going to put these containers this will work fine with no issues. Docker also allows you the social containers which can be published on social platforms.

System Requirement

  • OS : Linux OS – Ubuntu / RedHat / CentOS 64Bit
  • Memory : Minimum 4GB RAM
  • Disk : Minimum Recommendation 60GB
  • Processor : 64Bit Intel / AMD with Virtualization Support

Steps To Install Docker

Make sure, your system should meet a minimum requirement to run the Docker. You can buy a VPS from the very popular VPS provider like Hostinger, GoDaddy or Bluehost at a very cheap price. Deploy a fully managed VPS or cloud server at a very reasonable cost. Here I am using Ubuntu 18.04 virtual machine to show you the Docker installation steps

Step 1

Remove and Purge the older version if you have installed or failed/Stuck in between to install

# sudo apt-get remove docker docker-engine docker.io containerd runc

Step 2

Update your system and add the Docker Repository

# sudo apt-get update

# sudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg \lsb-release

Step 3

Now, add the Docker’s GPG key using the following command

# sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4

Make Repository stable using the following command

# sudo echo \
"deb [arch=amd64 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

Step 5

Once the above steps are done, you can now install the Docker

Update your system first after adding repository and gpg key

# sudo apt-get update

Install Docker using apt-get install. Skip this step and go to the next step if you want to install a specific available version of Docker

# sudo apt-get install docker-ce docker-ce-cli containerd.io

Step 6 ( Optional )

Check the available version

# sudo apt-cache madison docker-ce

Install the specific version from the available cache

# sudo sudo apt-get install docker-ce=<Version String> docker-ce-cli=<Version String> containerd.io

Step 7

The final step is to check the Docker version, start and verify the Docker

# sudo systemctl start docker

# sudo docker -v

# sudo docker run hello-world

Docker installation will take some time which depends on your internet speed. If you have followed the above steps properly then definitely you will achieve Docker in your Ubuntu system

Also Read : How to install Jenkins On CentOS

Video Tutorial

That’s All . . . In this tutorial, we have learned, how to install Docker on Ununtu OS. I have explained what is Docker as well as showed a step by step guide to install Docker  easily. Comment below or contact me if you have any doubts, queries regarding this post.

Leave a Reply

Your email address will not be published. Required fields are marked *