How to Install Authelia on Fedora CoreOS Latest

Authelia is an open-source authentication and authorization server that provides a single-sign-on solution for your web applications. In this tutorial, we will guide you through the installation process of Authelia on Fedora CoreOS Latest.

Prerequisites

Before proceeding with the installation of Authelia on Fedora CoreOS Latest, ensure that you have the following requirements:

Step 1: Install the Required Packages

First, connect to your Fedora CoreOS instance through your terminal, and ensure that you have the latest updates for the operating system.

sudo dnf update -y

Next, we will install the required dependencies for Authelia. Run the following command to install Nginx, OpenLDAP, and Redis.

sudo dnf install nginx openldap openldap-servers redis -y

Step 2: Configure OpenLDAP

Before we start with Authelia installation, we must configure OpenLDAP, which is a free and open-source software to manage authentication and authorization.

First, create a new OpenLDAP directory:

sudo mkdir /var/lib/ldap

Then, set appropriate permissions on the new directory:

sudo chown ldap:ldap /var/lib/ldap

Next, create a new OpenLDAP database:

sudo slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

Set read & write permissions for the OpenLDAP directory:

sudo chown -R ldap:ldap /etc/openldap/slapd.d/
sudo chown ldap:ldap /etc/openldap/slapd.conf

Now, you can enable and start the OpenLDAP service:

sudo systemctl enable --now slapd

Finally, create a new OU and User in OpenLDAP:

sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif
sudo ldapadd -x -D cn=admin,dc=fedora,dc=com -w <your-password> -f ~/authelia-ldap.ldif

Replace <your-password> with a secure password for the authelia-ldap.ldif file.

Step 3: Install and Configure Authelia

Next, we will install and configure Authelia.

Download the Authelia binary and extract it:

wget https://github.com/authelia/authelia/releases/download/v4.29.0/authelia-linux-amd64
chmod +x authelia-linux-amd64 && sudo mv authelia-linux-amd64 /usr/local/bin/authelia

Create a new Authelia directory and copy the config.yml and users_database.yml files:

sudo mkdir /etc/authelia
sudo cp authelia/config.yml.example /etc/authelia/config.yml
sudo cp authelia/users_database.yml.example /etc/authelia/users_database.yml

Edit the configuration files with your desired authentication settings.

sudo nano /etc/authelia/users_database.yml
sudo nano /etc/authelia/config.yml

Now, we will create a new Nginx configuration file for Authelia:

sudo nano /etc/nginx/conf.d/authelia.conf

Paste the following configuration:

server {
  listen 80;
  server_name example.com;
  return 301 https://$server_name$request_uri;
}

server {
  listen 443 ssl http2;
  server_name example.com;
  root /var/lib/nginx/html;
  index index.html index.htm;
  
  location / {
    proxy_pass http://127.0.0.1:9091;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

  ssl_certificate /etc/ssl/certs/cert.crt;
  ssl_certificate_key /etc/ssl/private/cert.key;
}

Replace example.com with your domain name, and update the SSL certificate files.

After creating the Nginx configuration, we will start the Authelia service:

sudo authelia start

Step 4: Test Authelia

Finally, we will test the Authelia installation.

First, ensure that the Authelia service is running:

sudo authelia status

If the service is running, try accessing the Authelia login portal from a web browser:

https://your-domain.com

You should see the login page of Authelia. You can now authenticate to access your secured web applications.

Congrats! You have successfully installed Authelia on Fedora CoreOS Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!