Before you get straight into the steps in order to install Docker on Ubuntu 18.04 Bionic Beaver, I would like to give you a little bit of a detailed study about what is Docker.
Docker is actually a tool that is developed in order to make things a bit easier. By ‘things’ I am talking about creating, deploying, and running applications by making the use of containers.
Now, if you are looking for what is a container, a container actually gives the allowance to a developer for packaging up an application with each and every part it requires such as libraries and any other dependencies and then, ship them all out as a single package.
Thus, Docker actually behaves like a virtual machine. But, there is a little different about Docker compared to a virtual machine.
And, that is Docker encourages the applications for using the exact same Linus kernel just like the system that they are running on and needs only applications to be shipped along with materials not working or running on the host computer system.
The Work of Docker
What this actually does is that it provides a prominent boost in the performance and lowers the size of the application. There is another point that is one of the most important ones for Docker.
Docker is actually an open-source tool and this actually allows literally anybody to donate to Docker and expand it in order to meet their own requirements in case they want extra specifications that are not present there openly.
This tool is basically designed for giving advantage to both the designers or developers and the system admins. This actually makes it a part of many ‘developers + operations’ (also known as DevOps) toolchains.
To the developers, this means that they will be able to pay the full attention for writing down codes with having no worries for the system on which it will actually be running.
For the operations staff members, this tool provides the elasticity or flexibility. And, it lowers the count of systems that are required for its small footprint and reduce overhead potentially.
Steps for Installing Docker on Ubuntu 18.04 Bionic Beaver
In this article here, I will let you gain a thorough knowledge of the steps that will help you to install Docker ubuntu 18.04 Bionic Beaver.
Before you get into the steps for the installation of Docker on Ubuntu, you need to remember these particular points that you need to have on your computer system. Here are they:
- As the subject says, you need to have Ubuntu 18.04 of the 64-bit operating system on your computer system.
- You have to create an account for the user with sudo facilities.
- Then, you will definitely need Command line/terminal (CTRL-ALT-T or Applications menu > Accessories > Terminal)
- This prerequisite is actually optional but still, it is important to mention here. It is the Docker software repositories.
How to install Docker on Ubuntu?
The First Step
This step is comprising of the process of updating the software repositories. It is actually good if you go for updating the local database of software in order to be ensured about the thing that you have got access to the most recent revisions.
As a consequence, you need to open a terminal window and then type the following: sudo apt-get update
Then, you have to let the operation get completed.
The Second Step
The next step is to remove or uninstall the old Docker software if there is any before you carry forward with the steps for the installation of Docker on the Ubuntu operating system. For this step, you need to use the following command:
sudo apt-get remove docker docker-engine docker.io
The Third Step
This is the step where we actually enter into the process of the installation of Docker on Ubuntu. This step is where you are going to do the installation of the Docker tool.
To do this, enter the command given below.
sudo apt install docker.io
The Fourth Step
This is the step where you are going to commence with Docker and automate it. The Docker service requires to be made ready on your computer system in order to run at startup.
For doing this, you need to type in each command following by pressing the enter key from the keyboard.
Here are the command lines as follows.
sudo systemctl start docker
sudo systemctl enable docker
The Fifth Step
The fifth step is actually not a mandatory one. This is often treated as an optional step. In this step, you actually need to verify the installed Docker version number.
You have to type the following code: docker –version
Thus, you will be able to install Docker on Ubuntu by the usage of builtin repositories.
Now, I will let you know about the steps for the installation of Docker on Ubuntu from an official repository.
The other method of installing Docker on Ubuntu: installing Docker from an Official Repository
The First Step
In the very first step, you have to do the update of the local database. For updating the local database, you have to write the following command: sudo apt-get update
The Second Step
In this step, you have to download the dependencies. For doing so, you will need to run the given commands mentioned below.
This will allow your operating system to have complete access in the Docker repositories over HTTPS. You need to type the following in the terminal window:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
For your easy understanding, here is a clarification about the commands.
- Apt-transport-https: This actually encourages the manager of the package for transporting the files and the data over https.
- Ca-certificates: This code gives allowance to the system as well as the web browser for the inspection of security certificates.
- Curl: This is just a piece of equipment that is used for the transfer of data.
- Software-properties-common: This is something that actually helps to add scripts in order to do the management of the software.
The Third Step
In this step, you have to add the GPG key of the Docker. The GPG key that I mentioned here is actually a security feature.
If you want to be sure that the application software you are going to use is authentic or not, you need to enter the following code:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
The Fourth Step
This is the step where you need to do the installation of the Docker repository. And, for installing the Docker repository you need to write the following command line:
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
‘$(lsb_release -cs)’ is the command that you see here is a code that actually performs the scanning and then returning the codename of the installation of your Ubuntu, in this particular case we are dealing with, Bionic Beaver.
You can also see the last word of the command line that says ‘stable’ is actually a category of Docker release.
A stable release is put to the experiment and is assured to operate but in this case, the updates do not get released quite often.
If you need frequent updates for yourself then you may switch edge just at the price of potential instability.
You can get many other repositories as well but they can be full of risks that can affect your system badly.
The Fifth Step
This step is inclusive of updating the repositories. For that, you to write the following command line: sudo apt-get update
The Sixth Step
This is the step where you will have to do the installation of the latest version of Docker. In order to do so, you need to type the following command:
sudo apt-get install docker-ce
The Seventh Step
This step is optional. Here you have to make the installation of a significant version of Docker.
You can list the available versions of Docker in a terminal window by typing the following command.
apt-cache madison docker-ce
Your system will be showing all the versions available. Now you have to type the following code.
sudo apt-get install docker-ce=<VERSION>
Your work will be done by now. Now, you have got two different options for doing the installation of Docker on Ubuntu 18.04 Bionic Beaver.
I hope you faced no issue with the steps of the installation. Let us know in the comment section how fruitful were the steps. Feedback from you will help us to help you better.