Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In your appdata/authelia folder you will find configuration.yml
You MUST edit this file to suit your environment. We strongly suggest you watch our video along with this guide to help you understand how it all works.
The sample provided in this guide has been tested and verified to work, however, it is strongly advised to read the official docs on the configuration to ensure it meets your requirements (https://www.authelia.com/docs/configuration/)
For secret keys, you can create a 128-bit encryption key to put in from here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx Remember to keep them different for the different areas which use them.
You have two options when deciding how you want users to exist for Authelia.
Option 1 - Using a simple YML file with the user's encrypted credentials that Authelia can read.
Option 2 - Allow Authelia to read from an LDAP database such as FreeIPA or Active Directory.
NOTE
The choice is yours, however, keep in mind that only one option can be used.
Decide which option works for you and make the edits in the configuration.yml, under the "authentication_backend
" section, by commenting out the option you do not want to use.
In the sidebar, you will find the file named 'users_database.yml'.
Copy the file content into appdata/authelia/users_database.yml.
You MUST edit this file.
Adjust the file to the user you would like to sign in as. For help see here: https://www.authelia.com/docs/configuration/authentication/file.html
Changes include the username and display name, for example.
To generate the hashed password, open the terminal in Unraid
Type in the following (replacing 'yourpassword' with the password you want for the user):
Copy the hashed password that is generated and paste it into the users_database.yml file as replacing the one in the template we provide.
Remember to comment out the 'ldap'
section in your configuration.yml since you are not using it.
If you prefer to use an LDAP database to read users from, you can do so by using the LDAP configuration in the sidebar.
Choose the type of LDAP you are using (i.e OpenLDAP, Active Directory or FreeIPA). We have a video guide on creating a FreeIPA server here and also a video on how to set up OpenLDAP here. --ADD-LINK-TO-VIDEO-HERE--
Edit the contents to suit your environment, where necessary
Replace the LDAP section in the Authelia configuration.yml with the new one
Remember to comment out the 'file
' section, since you are not using the users_database.yml file.
Want to see an OpenLDAP and phpLDAPadmin section here? Let us know in Discord or in the video description!
At this point, you should start the Authelia container and read the logs.
Test that you can reach the WebUI of Authelia (http://SERVERIP:9091) and can log in or set up 2FA.
For protecting your apps using Traefik as the reverse proxy, please see our guide on Traefik here
Copy the data in NGINX Config - Authelia and head to your NPM dashboard > Hosts > Proxy Hosts
Select Add Proxy Host
Details:
Domain name: auth.example.com (or whatever CNAME you set in your DNS for Authelia)
Scheme: http
Forward Hostname / IP: Name of your Authelia container (must be on the same custom docker network as NPM, otherwise use server IP)
Port: 9091
Turn ON: Cache Assets, Block Common Exploits
SSL:
Request new SSL certificate
Turn ON: Force SSL, HTTP/2 Support, HSTS Enabled (if using, i.e. in Cloudflare)
Email address: used to create Let’s Encrypt cert.
Select I Agree and Save.
Alternatively, see our guide on using Cloudflare Origin Certs
Test that you can reach the WebUI of Authelia selecting the new proxy or typing in its address. i.e. 'auth.example.com'
If all the above is working as intended; Edit proxy host 'auth.example.com'
Advanced
Under Custom Nginx Configuration, paste the config you customized from NGINX Config - Authelia
Save and confirm you can still access the WebUI via the URL.
Edit proxy host 'sonarr.example.com'
Advanced
Under Custom Nginx Configuration, paste the config from NGINX Config - Endpoint and customize as necessary.
(Optional) Now that Authelia is acting as your single sign-on security you can now disable any in-app security/logins. Disabling the in-app login will still be secure as Authelia will be protecting it but will prevent you from having to log in twice for every app and remember all of the usernames and passwords etc.
The rules section in the Authelia configuration file have some important notes to consider:
Rules are read by Authelia from top to bottom
Therefore, you should practice putting the most restrictive rules last.
A catch-all wildcard rule at the very end will safeguard you by applying a default policy on anything you have enabled Authelia on, without needing a specific rule.
There may be times when you want to allow certain apps to be covered by single-factor authentication, and others to be covered by two-factor authentication.
You can specify the user, groups, or both that can access a particular resource.
You can restrict access to a particular subfolder of a URL rather than the entire URL. For example, if you want to protect the Admin page of an application but not the main page itself.
You may have a combination of all the above if you so choose.
For a more in-depth look at access control, please see the official Authelia docs here.
WARNING
Below you will find a comprehensive list to read through as an example. This is a valid and working example, however, we do not recommend blindly copying it without fully understanding what the rules are doing.
For a more in-depth look at access control, please see the official Authelia docs here.
In the above, you may notice that certain rules are allowing API endpoints. This is important when you want to protect an application that uses API communications to send and receive data and do not want it to be hindered by Authelia.
A classic example is Sonarr or Radarr. These applications need the API to talk to other applications and since they are unable to 'sign in' to Authelia themselves, we need to tell Authelia that:
We want to protect sonarr.domain.com with Authelia
However, we want to bypass Authelia for traffic coming in and out of the API endpoint of Sonarr
Here's how that would look (extracted from the example above):
Again, remember the hierarchy. We want the bypass to be above any restrictive rules so that Authelia knows that bypassing this endpoint comes first.
Authelia / Sycotix's Repository / Security
File editors such as Notepad++ or Code-Server
Domain with the following subdomains
NOTE: You may change these but keep in mind you must adapt it throughout the guide. (app.example.com is simply any app you want to protect with Authelia, i.e. sonarr.example.com).
example.com
auth.example.com
app.example.com
We strongly suggest using Code-Server to help you edit your configuration files and validate everything is correctly formatted.
YAML is extremely sensitive, and Code-Server, along with the YAML plugin, can be extremely helpful to save a lot of time troubleshooting. (Trust us, we've been helping members with Authelia for over a year!)
You can follow our guide here.
Redis is an in-memory data structure store, used as a distributed, in-memory key-value database, cache, and message broker, with optional durability.
In Unraid, visit the apps tab
Search for and install 'redis'. We are using the container from A75G's Repository
which uses the Bitnami Redis image.
It has parameters mapped for a password, which we will need to add into configuration.yml later.
In the template installation screen:
Set the custom docker network
Set a strong password (it will be used by Authelia later)
Add the appdata path as per the below
IMPORTANT
The default template does not have a mapping for the appdata storage. Without this, Redis will not be able to cache your data and the 'Remember Me' option in Authelia will not work.
In the template, click "Add another Path, Port, Variable, Label or Device" and add the following path:
Container Path: /bitnami/
Host Path: /mnt/user/appdata/redis/bitnami/
IMPORTANT
Change the permissions of the redis folder with the following command executed in the webterminal: chmod -R 777 /mnt/user/appdata/redis/*
If you do not already have MariaDB installed, then follow the next 3 steps. If you already have MariaDB installed then skip to the next section where you will create the database for Authelia.
In Unraid, visit the apps tab
Search for and install 'mariadb'. We are using the linuxserver/mariadb container.
In the template installation screen:
Set the custom docker network
Set a strong password
Once installed, follow these steps to create our user and database for Authelia.
If you want a GUI option to create, manage and administer databases, we recommend using Adminer. You can find our guide on that here.
Follow our Adminer + MariaDB guide to use a GUI to help you manage databases in an easy way.
If you want to use the command-line to create the database then please do the following:
Under the Docker tab in Unraid, left-click the MariaDB container, select Console
Create our user:
Enter the following then hit enter:
Enter the password you set in the container settings then type:
This password will be referenced in the Authelia configuration.yml
Create our database:
Enter the following then hit enter:
Allow privileges to the database:
Enter the following then hit enter:
This is the password you created for the user above.
Enter the following then hit enter:
You can now close the terminal window
Head to the Community Applications store in Unraid
Search for and click to install Authelia
from Sycotix's Repository
If you are using a custom Docker network, select it in the 'Network Type' field.
Enter the host port you want to map for the WebUI. By default it is 9091
. Only change it if this port is already in use.
Click Apply and wait for the container to pull down and start.
NOTE
The container will immediately shut down due to no configuration. This is normal and you can leave it off for now.
Authelia is an open-source authentication and authorization server providing two-factor authentication and single sign-on (SSO) for your applications via a web portal.
Several second-factor methods:
Password reset with identity verification using email confirmation.
Access restriction after too many invalid authentication attempts.
Fine-grained access control using rules which match criteria like subdomain, user, user group membership, request URI, the request method, and network.
The choice between one-factor and two-factor policies per-rule.
Support of basic authentication for endpoints protected by the one-factor policy.
Highly available using a remote database and Redis as a highly available KV store.
Kubernetes Support:
To assist you in building your configuration, we have used frequent placeholders for you to easily find and replace with your own specific information. This allows a quick Find/Replace in your preferred text editor.
YOURPASSWORD - Password which you have set, with respect to the section you are reading. i.e. MySQL passwords should be different from your Redis password.
YOURSECRET - A secret 128-bit encryption key. You can use this site to generate them:
YOURDOMAIN - Your own domain name
SERVERIP - Local IP address of your host server. i.e. 192.168.1.50
CONTAINERPORT - Port the container is running on.
CONTAINERNAME - Name of the container to be proxied. i.e. 'monitorr'
CONTAINERIP - IP address of the container.
We hope you enjoyed this guide. It was conceptualized, written, and implemented by our Admin Sycotix.
Our work sometimes takes months to research and develop. If you want to help support us please consider:
Please read our disclaimer .
with .
with .
with .
Compatible with out of the box using the middleware.
Curated configuration from via their container as well as a .
Compatible with the , the , and the controllers out of the box.
Beta support for installing via Helm using our .
Beta support for .
Liking and Subscribing to our
Joining our
Becoming a paid member on our
Donating via
Writer / Producer | Sycotix |
Contributor | Hawks |
Testing / Proofreading | DiscDuck, Hawks |