Docker: installation and concrete use on Ubuntu


In this tutorial, I will explain to you how to install Docker on Ubuntu and then through a concrete example how and why to use Docker.

At the time of writing this tutorial (in 2021) as SysAdmin, I was having a hard time finding a concrete use for containers including Docker (so I’ll let you imagine Kubernetes).

This is not necessarily true, in a PROD environment, I have a few examples, but nothing to thrill the planet …

Most of the tutorials, which can be found on the Internet, explain how to install Docker and then create one or more containers to use a LAMP server, something that is done very well without container and just as quickly …

I’m not saying the tutorials aren’t good, just the lack of interest …

Wishing to put in place a forum type solution for RDR-IT, I found a discourse that allows me to link a forum and comments for my various WordPress sites.

After a local test on a dedicated VM, I validate the solution, I love it, then comes the time to think about how to put it into production … I currently have two VPS (one dedicated to web hosting with Cyberpanel and another where I only run my gitlab server).

I don’t want to install the Disourse prerequisites on the Web server, because Discourse needs a lot of things (Web server, PostgreSQL, Redis, Ruby …), on the server at Gitlab is working, I’m a little afraid, because Gitlab and Discourse use the same components … I’m starting to think I need a third server … and I’m starting to backtrack because it’s extra money and my various attempts to setting up a forum have been failures every time.

A light comes on, Gitlab and Discourse both offer Docker containers … and I’m thinking maybe now is the time to test that and I’m finally starting to find a container app and I’m making up my mind so to test this solution in lab (local), which would allow me to run my Gitlab and discourse on the same server.

There remains one problem to be solved which is the use by the two applications of a Web server and their use of port 80 and 443, to solve this problem, I will use Nginx as a reverse proxy installed locally on the server (I could also have used the Nginx container for that …).

In this tutorial I will be using a virtual machine on Ubuntu Server 20.04

Leave a Comment