Install Docker GNU Linux

How to Install Docker on Ubuntu?


Nowadays software portability has become increasingly relevant. The architecture of computers and operating systems is constantly evolving; applications become larger in every sense. It often happens when administrator needs to transfer the program to another machine without installing and configuring it from scratch. For these purposes, a special software was developed (like Docker). This article describes how to install Docker on Ubuntu and other GNU/Linux systems.

Docker’s Software and Hardware Requirements

Docker installation is happening in the same way as a regular program. Despite the fact that it has quite complex structure and working principles, it does not need a high requirements for effective work:

  • 64-bit system;
  • System kernel version above 3.10;
  • High-speed internet;
  • Static IP;
  • At least 4 GB of RAM for workers node;
  • At least 8 GB for corporate use;
  • 3 GB or more free disk space;
  • At least 4 GB swap.

Note! With an active VPN connection, the program may crash. In this case, first enable Docker (in particular, the daemon), and then VPN.

Installing Docker in Linux

There are two versions of this software: Community Edition and Enterprise Edition. The main difference is that when using EE, you can also get advice from the development company on setting up and using Docker at any time. In this example we are using the CE version. It is assumed that prior to the installation, no other instances of this software were installed in the system. Otherwise, delete them.

Debian-based Systems

On Ubuntu, Mint, and other Debian-based systems, Docker is missing from the base repositories.

First, you need to download the supporting tools:

sudo apt update && sudo apt install aptitude && yes | sudo aptitude install apt-transport-https ca-certificates curl software-properties-common

Next, load and fix the Docker repository key:

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

Write the Docker repository to the general list of software sources:

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

Update the list of repositories and install the program:

sudo aptitude update && yes | sudo aptitude install docker-ce

Run the daemon:

sudo /etc/init.d/docker start

“Red Hat”-based Systems

Here the situation is the same: there is no Docker in standard repositories, you need to add it manually.

First we load the auxiliary utilities:

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Add the Docker repository:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install the program:

sudo yum install docker-ce

Turn on the daemon:

sudo systemctl start docker

Arch-based Systems

On Arch, Manjaro, and the like, the entire installation can be done with one command:

yes | sudo pacman -S docker

The daemon is also enabled using systemd:

sudo systemctl start docker

Using Docker

To test the program, load the test container “hello-world” with the command:

docker run hello-world

install docker linux

Using the run command may be prohibited due to a lack of privileges. To solve the problem, just add the user to the docker group:

sudo gpasswd -a USERNAME docker

install docker ubuntu

View a list of all containers installed on the computer:

docker ps

More details about all the program options can be listed with the command:

docker --help

Download all images from Docker Hub.

You may also like:

Configuring SSH Key-Based Authentication on Linux The Internet is full of manuals on how to configure the SSH key-based authentication on a Linux server. Every time we have to do this, we were searchi...
Ubuntu Update Command Keeping your operating system fresh and safe is a priority in PC administration. Distributions often differ in the concept of receiving updates: someo...
How to Reset Root Password in MySQL and MariaDB? In older versions of MySQL, if you forgot or lost the root password for MySQL, you could view the current password in the my.cnf file. In modern versi...
ls Command in Linux Commands in the GNU/Linux terminal greatly simplify any interaction with the system. Among them are frequently used ones, such as viewing a list of fi...
How to Use ntpdate to Sync Time in Linux? Ntpdate is a console utility that can be used as an NTP client in various Linux distros to synchronize the local time of a host with the global time o...

Add Your Comment