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

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

What is GEEK

Buddha Community

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

Prerequisites

To follow this tutorial, you will need the following:

  • One Ubuntu 20.04 server set up by following  the Ubuntu 20.04 initial server setup guide, including a sudo non-root user and a firewall.
  • Docker installed on your server, which you can do by following  How to Install and Use Docker on Ubuntu 20.04.
  • Docker Compose installed with the instructions from  How to Install Docker Compose on Ubuntu 20.04.
  • A domain and three A records, db-admin.``your_domainblog.``your_domain and monitor.``your_domain. Each should point to the IP address of your server. You can  learn how to point domains to DigitalOcean Droplets by reading through DigitalOcean’s Domains and DNS documentation. Throughout this tutorial, substitute your domain for your_domain in the configuration files and examples.

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:

#traefik #docker #docker containers #ubuntu 20.04

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

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

Shawn  Pieterse

Shawn Pieterse

1625719345

Upgrade Ubuntu 20.04/20.10 to 21.04 in 2 Ways (GUI & Terminal)

Ubuntu 21.04, codenamed Hirsute Hippo, is released on April 22, 2021. This tutorial is going to you 2 ways to upgrade Ubuntu 20.04/Ubuntu 20.10 to 21.04. The first method uses the graphical update manager and the second method uses command line. Usually, you use the graphical update manager to upgrade Ubuntu desktop and use the command line to upgrade Ubuntu server, but the command-line method works for desktops too.

Ubuntu 20.04 is a long-term support (LTS) release, which will be supported for 5 years. Ubuntu 21.04 is a non-LTS release, which means it will be supported for 9 months only, until January 2022. If you prefer stability over bleeding edge, then stick with Ubuntu 20.04. But if you are the other way around, you can follow this tutorial to upgrade from Ubuntu 20.04 to 21.04.

#ubuntu #ubuntu desktop #ubuntu server #upgrade #ubuntu 20.04

Alycia  Klein

Alycia Klein

1596719640

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.

Install Jenkins On Ubuntu 20.04

Install Java

Since Jenkins is written in Java, it requires Java 8 or Java 11 to run. Here, I will install the OpenJDK 11 for Jenkins installation.

sudo apt update

sudo apt install -y default-jre apt-transport-https wget

If you want to use the Oracle Java in place of OpenJDK, then use any one of the links to install it.

READ: How To Install Oracle Java on Ubuntu 20.04

READ: How To Install Oracle Java on Ubuntu 18.04

Verify the Java version after the installation.

java -version

Output:

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Add Jenkins Repository

Jenkins provides an official repository for its packages. To use the Jenkins repository, first, we will need to add the Jenkins public key to the system.

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

Then, add the Jenkins repository to your system.

echo "deb https://pkg.jenkins.io/debian-stable binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list

Install Jenkins

Install Jenkins package using the apt command.

sudo apt update

sudo apt install -y jenkins

The Jenkins service should now be up and running. You can check the status of the Jenkins service using the below command.

sudo systemctl status jenkins

#ubuntu #jenkins #ubuntu 18.04 #ubuntu 20.04

Shawn  Pieterse

Shawn Pieterse

1625711252

Installing PHP 8.0 on Ubuntu 20.04 and Ubuntu 18.04

Add PHP Repository

  • Update the repository cache.
  • Install the below packages.
  • Add the repository to your system.
  • Update the repository index.

Install PHP
Install PHP 8.0 on Ubuntu 20.04 / Ubuntu 18.04
Install PHP 7.x on Ubuntu 20.04 / Ubuntu 18.04
Verify PHP Version
PHP Support for Web Server
Both Apache and Nginx do not support PHP language by default when the browser requests the PHP page. So, we need to install the PHP module package to support PHP.

#ubuntu #php 8.0 #ubuntu 20.04 #ubuntu 18.04