Docker: installation and concrete use on Ubuntu

Installation of prerequisites

Before launching into the Docker installation, we will first install a few packages:

  • Cockpit : which is a web graphical interface that will allow us to administer our Ubuntu server and containers
  • Nginx : which will be used as a reverse proxy to publish the Gitlab and Discourse
  • certbot : which will generate Let’s Encrypt certificates

Cockpit installation

Entrer la commande suivante :

Ubuntu cockpit install

Once the cockpit is installed, it is available at the following address: https: //server_ip:9090

In order to be able to manage Docker containers, it is necessary to install an additional module.

At the time of writing, the add-on is not officially available for version 20.04, but version 19.10 does work.

Download the .deb using the wget command

Install the .deb:

Wait during the installation:

Cockpit Docker install

Une fois installée, retourner sur l’interface de cockpit et actualiser, le menu Docker Container est disponible.

Module docker container available on cockpit

Installing the cockpit-docker module installs the Docker package, which will be uninstalled later to use the official Docker repository.

It is also possible to install the cockpit-docker module after the installation of Docker, which avoids the uninstallation.

Installing Nginx

As several Web servers will be exposed with the containers, we will install Nginx in order to have a reverse proxy, it is also possible to use Apache2.

We could also have used the Nginx container.

Use one of the commands below to install Nginx on the server:

Installing Certbot

This installation is optional, it will make it possible to generate Let’s Encrypt certificates in order to make the various applications accessible in HTTPS.

To install Certbot for Nginx enter the command:

Install certbot for nginx

Now that we have installed the necessary prerequisites, we will move on to installing Docker on the Ubuntu server.




Leave a Comment