How to Install Authelia on Fedora Server Latest

Authelia is a powerful authentication server that provides single sign-on (SSO) functionality to your applications. This tutorial will guide you through the process of installing Authelia on a Fedora Server latest.

Prerequisites

Step 1 - Install and configure Docker

Docker is a powerful tool that you will use to execute Authelia's processes. To install and configure Docker, follow the steps below:

  1. Open a terminal and run the following command to add the Docker repository:
sudo dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo
  1. Next, install Docker by running:
sudo dnf install docker-ce docker-ce-cli containerd.io
  1. Start the Docker service by executing the following command:
sudo systemctl start docker
  1. Enable the Docker service to start automatically at system boot by running:
sudo systemctl enable docker
  1. To verify that Docker is installed and operating correctly, run the following command:
sudo docker run --rm hello-world

Step 2 - Install Authelia

You will install Authelia by running it in a Docker container. Follow the steps below:

  1. Create a new directory for Authelia by running the following command:
sudo mkdir /etc/authelia
  1. Navigate to the newly created directory:
cd /etc/authelia
  1. Create a new file called docker-compose.yml by executing the following command:
sudo vim docker-compose.yml
  1. In the newly created file, copy and paste the following YAML code:
version: '3'
services:
  authelia:
    image: authelia/authelia
    container_name: authelia
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - ./config:/etc/authelia
      - ./data:/var/lib/authelia
      - ./certificates/acme.json:/acme.json
    restart: always
    networks:
      - app_net
  
networks:
  app_net:
  1. Save and close the file.
  2. Next, you will create a configuration file for Authelia by running the following command:
sudo vim config.yml
  1. In the new file, copy and paste the following YAML code:
log_level: info

ldap:
  host: "ldap://ldap.forumsys.com"
  user_dn: "cn=read-only-admin,dc=example,dc=com"
  password: "password"
  base_dn: "dc=example,dc=com"
  additional_users_dn: "ou=users,dc=example,dc=com"
  group_dn: "ou=groups,dc=example,dc=com"
  additional_groups_dn: "ou=groups,dc=example,dc=com"
  override_username: ""
  start_tls: false
  scope: 2
  user_attribute: "uid"
  group_attribute: "cn"
  group_member_attribute: "memberUid"
  look_for_member_of: true
  idle_timeout: 5m
  cache:
    enabled: false
    size: 10000
    ttl: 1h
    interval: 10m

authelia:
  issuer: "https://example.com"
  jwt_secret: "thEakdpW5m5FFv" # replace with your own secret
  session:
    domain: "example.com"
    name: "authelia"
    secret: "0eb41fe92ce540d1d0f2d0eaa7bde550b190256572d9e0e9054fbd4dc4fe378547d43e41ebc51656934b4282f464a3c9d3fe422e8cf4fec4e17fb83c4fbbbc21" # replace with your own secret
  ldap:
    url: "ldap://ldap.forumsys.com"
    user_base_dn: "dc=example,dc=com"
    enabled: true
  notifier:
    journald:
        enabled: false
    smtp:
      host: smtp.example.com
      port: 587
      preferred_encoding: ""
      subject: Authelia Notification
      identifier: "authelia@example.com"
      username: "authelia@example.com"
      password: "myemailpassword" # replace with your own password
      
access_control:
  # Define the default rules used to deny access to your resources.
  default_policy: deny

  # List of rules allowing access to any URL.
  rules:
    # Allows everyone to access the login page.
    - domain: example.com
      path: /signin
      methods: [ GET, POST ]
      identity_verifier: none
      policy: bypass
    # Allows access to the dashboard only if authenticated.
    - domain: example.com
      path: /dashboard
      methods: [ GET, POST ]
      policy: one_factor
    
  1. Save and close the file.

Step 3 - Start and enable Authelia

To start and enable Authelia to run automatically whenever the server boots up, follow the steps below:

  1. Run the following command to start the Authelia container:
sudo docker-compose up -d

The -d switch starts the container in detached mode, which allows you to exit the terminal session without stopping the container.

  1. To verify that Authelia has started, navigate to your web browser and visit the following URL:
https://<hostname>:8080
  1. Finally, enable the Authelia service to automatically start at boot by running the following command:
sudo systemctl enable docker-compose@authelia

Conclusion

You have successfully installed Authelia on Fedora Server latest. You can now use Authelia's powerful SSO functionality to secure your applications. If you encounter any issues, refer to Authelia's documentation for more information.

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!