How To Use Traefik as a Reverse Proxy for Docker Containers on Ubuntu 20.04

How To Use Traefik as a Reverse Proxy for Docker Containers on Ubuntu 20.04

Traefik is a Docker-aware reverse proxy that includes its own monitoring dashboard. In this tutorial, you’ll use Traefik to route requests to two different web application containers: a Wordpress container and an Adminer container, each talking to a MySQL database. You’ll configure Traefik to serve everything over HTTPS using Let’s Encrypt.

Step 1 — Configuring and Running Traefik

The Traefik project has an  official Docker image, so we will use that to run Traefik in a Docker container.

But before we get our Traefik container up and running, we need to create a configuration file and set up an encrypted password so we can access the monitoring dashboard.

We’ll use the htpasswd utility to create this encrypted password. First, install the utility, which is included in the apache2-utils package:

sudo apt-get install apache2-utils

Then generate the password with htpasswd. Substitute secure_password with the password you’d like to use for the Traefik admin user:

htpasswd -nb admin secure_password

The output from the program will look like this:

Output
admin:$apr1$ruca84Hq$mbjdMZBAG.KWn7vfN/SNK/

You’ll use your unique output in the Traefik configuration file to set up HTTP Basic Authentication for the Traefik health check and monitoring dashboard. Copy your entire output line so you can paste it later. Do not use the example output.

To configure the Traefik server, we’ll create a new configuration file called traefik.toml using the TOML format.  TOML is a configuration language similar to INI files, but standardized.  This file lets us configure the Traefik server and various integrations, or providers, that we want to use. In this tutorial, we will use three of Traefik’s available providers: apidocker, and acme. The last of these, acme supports TLS certificates using Let’s Encrypt.

traefik docker docker containers ubuntu 20.04

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How To Use Traefik as a Reverse Proxy for Docker Containers on Ubuntu 20.04

Traefik is a Docker-aware reverse proxy that includes its own monitoring dashboard. In this tutorial, you’ll use Traefik to route requests to two different web application containers: a Wordpress container and an Adminer container, each talking to a MySQL database. You’ll configure Traefik to serve everything over HTTPS using Let’s Encrypt.

Install Docker | Docker Compose on Ubuntu 20.04

This brief tutorial shows students and new users how to install Docker and Docker Compose on Ubuntu 20.04 | 18.04. Docker software allows visualization at the operating system level..

How To Install Jenkins on Ubuntu 20.04 / Ubuntu 18.04

Jenkins is an open-source automation server that helps to automate the repetitive tasks involved in the software development process, which includes building, testing, and deployments. Jenkins was forked from the Oracle Hudson project and written in Java. Here, we will see how to install Jenkins on Ubuntu 20.04 / Ubuntu 18.04.

How to Install Docker on Ubuntu 20.04

This tutorial covers how to install Docker on an Ubuntu 20.04 machine. Docker is an open-source containerization platform that allows you to quickly build, test, and deploy applications as portable containers that can run virtually anywhere.

How To Install Nvidia Drivers On Ubuntu 20.04 / Ubuntu 18.04 | ITzGeek

In this article we will learn how to install Nvidia Drivers On Ubuntu 20.04 / Ubuntu 18.04 . All Desktops and Laptops come with a graphics card for displaying images over a monitor.