How to install Docker on Ubuntu 18.04 and derivatives?

Docker on Ubuntu

The use of virtualization is becoming more relevant every day, because with the improvements and new features that they are providing, they make it easier to use technology. This makes both companies and end users have the ease and security of being able to use it.

With her you can perform various activities and run both operating systems and applications without compromising the host operating system, since they work in a totally isolated space.

This time let's take a look at DockerWhich is a cross-platform open source application which automates the deployment of applications within software containers, providing an additional layer of abstraction and automation of Virtualization at the operating system level on Linux.

Many of you have already heard or used Docker because it is already quite famous, with it basically we can perform container virtualization at the operating system level, but with the assurance that Docker uses Linux kernel resource isolation features such as cgroups and namespaces to allow independent containers to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.

Docker handles two versions one that is paid for EE companies (Enterprise Edition) and the other is the free version which is the one from the CE community (Community Edition).

For our case vWe masters to use the free version.

Before starting the installation we must uninstall any installation before done in case of updating, In addition to telling you that this method also applies to Ubuntu Artful 17.10, Ubuntu Xenial 16.04 and Ubuntu Trusty 14.04.

Now dwe need to open a terminal (Ctrl + Alt + T) and run the following command To remove previous installations of Docker:

sudo apt-get remove docker docker-engine docker.io

Done this, totime should we update our repositories with:

sudo apt-get update

And any package:

sudo apt-get upgrade

Install Docker CE on Ubuntu 18.04

install docker on Ubuntu

We must install some dependencies required for Docker with these commands:

sudo apt-get install \

apt-transport-https \

ca-certificates \

curl \

software-properties-common

Done this now we must import the GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

We must verify that the fingerprint sea 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, looking for the last 8 characters of the fingerprint.

For this we can run this command:

sudo apt-key fingerprint 0EBFCD88

Which should return something like this:

pub   4096R/0EBFCD88 2017-02-22

Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88

uid Docker Release (CE deb) <docker@docker.com>

sub 4096R/F273FCD8 2017-02-22

Now we must add the repository to the system with the following command:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

If you get an error you can add it manually by editing the sources.list, to do this from the terminal you type:

sudo nano /etc/apt/sources.list

And you add the following line, preferably at the end:

deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

Where do you replace Bionic if you are not using 18.04 for artful for 17.10, xenial for 16.04 or trusty for 14.04.

Once this is done, we update our list of repositories with:

sudo apt-get update

And now we can now install Docker on our system, we just have to type the following command:

sudo apt-get install docker-ce

Once the installation is complete, it is advisable to restart your computer, since the Docker services start automatically when you start your system.

For verify that Docker has been installed successfully and that is already running on the system we can perform a simple test, we just have to open a terminal again and execute the following command:

sudo docker run hello-world

Finally we must add the Docker group to our user since this is created in the system, but it is not added automatically, for this on the terminal we execute:

sudo usermod -aG docker $USER

And voila, if we want to update our version of Docker to a more recent one, we only have to execute:

sudo apt-get install docker-ce

If you want to know more about it, you can consult its installation guide for more platforms, in the link is this.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Yoel lopez said

    I had problems when logging in and with the wifi

    1.    Diego A. Arcis said

      Youtube?

  2.   jesus said

    In Ubuntu 18 it doesn't work. Have you tried it first?

  3.   SDK_Ming said

    Hello, thanks for the tutorial, it has come from a scandal. Just comment that the repository line fails, since Docker seems to have not released the "stable" version yet and you have to add "test"

    The correct one would be:

    deb [arch = amd64] https://download.docker.com/linux/ubuntu bionic test

    Verified and working.

    regards

  4.   DCR said

    thanks!….