
Authelia is an open-source authentication and authorization server, powered by Go and React, that provides multi-factor authentication (MFA), single sign-on (SSO), and OpenID Connect (OIDC) support. The application was designed to integrate with reverse proxies like Traefik or Nginx, acting as a companion for securing web applications. What makes it special: passwordless logins with passkeys, strong protection against brute-force attacks, fine-tuned authorization controls, and a straightforward user interface. Unlike SaaS models like Auth0 and PingID, Authelia is self-hosted, giving you full ownership of your data and infrastructure. In this article, we will show you how to set up Authelia on Debian 13.
Table of Contents
Prerequisites
- A Debian 13 server
- SSH root access or a regular system user with sudo privileges
Conventions
# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user
Step 1. Update the System
First of all, we need to log in to our Debian 13 VPS through SSH:
ssh root@IP_Address -p Port_number
Replace “root” with a user with sudo privileges, or root if needed. Also, replace “IP_Address” and “Port_Number” with your server’s IP address and SSH port. Next, let’s make sure that we’re on Debian 13. You can do that like this:
# lsb_release -a
The command should return an output similar to this:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 13 (trixie)
Release: 13
Codename: trixie
That’s it; the system package information is now updated.
Step 2. Install Docker
Authelia supports several installation methods. In this article, we will install it using Docker. There are several ways to install Docker on a Debian 13. In this step, we will install Docker Engine from Docker’s APT repository. This is the best and most recommended way to install Docker because it makes updates easy. Before installing Docker Engine for the first time on a new host machine, configure the Docker APT repository. Then you can install and update Docker from the repository.
Execute these commands to add and set up Docker’s APT repository.
# install -m 0755 -d /etc/apt/keyrings
# curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# chmod a+r /etc/apt/keyrings/docker.gpg
Then, add Docker’s APT repository to the APT sources.
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
Once added, update the system’s package index files.
# apt update
Finally, install the Docker packages.
# apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
That’s it; Docker has been installed on your Debian system. We can run the command below to verify the installation.
# docker version
It will show you an output like this:
Client: Docker Engine - Community
Version: 29.9.1
API version: 1.56
Go version: go1.26.9
Git commit: dfc520d
Built: Wed Oct 14 18:33:14 2026
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 29.9.1
API version: 1.56 (minimum version 1.40)
Go version: go1.26.9
Git commit: b26fb77
Built: Wed Oct 14 18:33:14 2026
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v2.4.2
GitCommit: b7a25261e029d68978bbf290df0a62fc819b3c51
runc:
Version: 1.5.2
GitCommit: v1.5.2-0-g29dd3dc2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Step 3. Install Authelia
The previous step installed the dependencies and added the repository. Now we can install Authelia.
Let’s create a directory called authelia in the /opt directory:
# mkdir /opt/authelia/{config,data,secrets} -p
Now, let’s generate the JWT secret for reset-password identity validation. Run these commands:
# openssl rand -base64 48 > /opt/authelia/secrets/jwt_secret
# openssl rand -base64 48 > /opt/authelia/secrets/session_secret
# openssl rand -base64 48 > /opt/authelia/secrets/storage_encryption_key
# chmod 600 /opt/authelia/secrets/*
# chmod 700 /opt/authelia/secrets
Step 4. Create Docker Compose File
In this step, we will create a Docker Compose file; we will use this file to install Authelia.
# nano /opt/authelia/docker-compose.yml
Insert the following into the file:
services:
redis:
image: redis:7-alpine
container_name: authelia-redis
restart: unless-stopped
command: "redis-server --requirepass m0d1fyth15"
volumes:
- ./redis:/data
networks:
- authelia-net
authelia:
image: authelia/authelia:latest
container_name: authelia
restart: unless-stopped
depends_on:
- redis
volumes:
- ./config:/config
- ./data:/data
- ./secrets:/secrets:ro
environment:
TZ: America/Chicago
AUTHELIA_JWT_SECRET_FILE: /secrets/jwt_secret
AUTHELIA_SESSION_SECRET_FILE: /secrets/session_secret
AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE: /secrets/storage_encryption_key
ports:
- "127.0.0.1:9091:9091"
networks:
- authelia-net
networks:
authelia-net:
driver: bridge
Save the file, then exit from the editor.
Step 5. Create the Authelia Configuration
# nano /opt/authelia/config/configuration.yml
Insert the following into the file:
theme: auto
server:
address: tcp://0.0.0.0:9091
log:
level: info
totp:
issuer: yourdomain.com
authentication_backend:
password_reset:
disable: false
file:
path: /config/users_database.yml
identity_validation:
reset_password:
jwt_secret: '{{ secret "/secrets/jwt_secret" }}'
access_control:
default_policy: deny
rules:
- domain: auth.yourdomain.com
policy: bypass
- domain: app.yourdomain.com
policy: two_factor
subject:
- group:admins
session:
cookies:
- name: authelia_session
domain: yourdomain.com
authelia_url: https://auth.yourdomain.com
default_redirection_url: https://app.yourdomain.com
expiration: 1h
inactivity: 5m
remember_me: 1M
redis:
host: redis
port: 6379
password: 'm0d1fyth15'
regulation:
max_retries: 5
find_time: 2m
ban_time: 10m
storage:
local:
path: /data/db.sqlite3
notifier:
filesystem:
filename: /data/notification.txt
Save the file, then exit.
Important notes:
default_policy: deny blocks anything not explicitly allowed.
auth.yourdomain.com uses bypass so users can access the login portal.
app.yourdomain.com requires two_factor.
domain: example.com allows cookies to work across auth.example.com and app.example.com.
Step 6. Generate an Authelia Password Hash
Authelia stores hashed passwords in users_database.yml. We need to run the command below; enter your desired password when prompted:
docker run --rm -it authelia/authelia:latest \
authelia crypto hash generate argon2
You will get an output like this:
Digest: $argon2id$v=19$m=65536,t=3,p=4$65Nn+g+Lsst9/uQZ76htGA$+VOnm9qgaRqlaP8vpdI4qHuFzF4/9GVnvcMpkXSAtjg
Now, save a copy of the hash, you will need to use your own, the one you see here is just an example.
$argon2id$v=19$m=65536,t=3,p=4$65Nn+g+Lsst9/uQZ76htGA$+VOnm9qgaRqlaP8vpdI4qHuFzF4/9GVnvcMpkXSAtjg
With the new hash generated, we can now create the users database file.
# nano /opt/authelia/config/users_database.yml
Insert the following:
users:
admin:
displayname: "Admin User"
password: "$argon2id$v=19$m=65536,t=3,p=4$65Nn+g+Lsst9/uQZ76htGA$+VOnm9qgaRqlaP8vpdI4qHuFzF4/9GVnvcMpkXSAtjg"
email: admin@example.com
groups:
- admins
Before saving the file, replace the password hash with your own.
Now, let’s give the file the correct permissions:
# chmod 600 /opt/authelia/config/users_database.yml
Step 7. Validate the Authelia Configuration
Authelia validates configuration at startup and can also validate it manually with the authelia config validate command. This checks for invalid keys, renamed keys, invalid values, and conflicting configuration options.
Run:
# cd /opt/authelia
# docker run --rm \
-v /opt/authelia/config:/config \
-v /opt/authelia/data:/data \
-v /opt/authelia/secrets:/secrets:ro \
authelia/authelia:latest \
authelia config validate --config /config/configuration.yml
If successful, you will see this message:
Configuration parsed and loaded successfully without errors.
We can continue from here.
If there are errors, we need to fix the reported configuration line before starting Authelia.
Step 8. Start Authelia
Since there was no issue running the validation command in the previous step, we can now start Authelia.
# docker compose up -d
Wait until it’s up and running.
You can check it using this command:
# curl -I http://127.0.0.1:9091
The command will show you a message like this:
HTTP/1.1 200 OK
Date: Tue, 20 Oct 2026 12:56:52 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2582
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: accelerometer=(), autoplay=(), camera=(), display-capture=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), screen-wake-lock=(), sync-xhr=(), xr-spatial-tracking=(), interest-cohort=()
X-Frame-Options: DENY
X-Dns-Prefetch-Control: off
Content-Security-Policy: default-src 'self'; base-uri 'self'; connect-src 'self'; frame-ancestors 'none'; frame-src 'none'; object-src 'none'; script-src 'self'; style-src 'self' 'nonce-lbciAS41QCPYrP3a2WfHXAuIuc2H6PIV'
It means that Authelia is up and running.
That’s it! Authelia and Redis are installed, and it should be up and running now. You can check it with this command:
# docker ps
It will show an output similar to this:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fc7f7d773244 authelia/authelia:latest "/app/entrypoint.sh" 1 minutes ago Up 1 minutes (healthy) 127.0.0.1:9091->9091/tcp authelia
9336d987ea05 redis:7-alpine "docker-entrypoint.s…" 1 minutes ago Up 1 minutes 6379/tcp authelia-redis
Step 9. Install and Configure Nginx
Authelia supports a number of reverse proxies. In this step, we will install and configure Nginx, and also install certbot to generate SSL certificates. Let’s just run this command to install it from the default Debian repository:
# apt install nginx python3-certbot-nginx -y
Now, create an nginx server block.
# nano /etc/nginx/conf.d/authelia.conf
Insert the following
server {
listen 80;
server_name auth.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:9091;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}
}
Next, let’s generate an SSL certificate.
# certbot --nginx -d auth.yourdomain.com
Make sure to replace auth.yourdomain.com with your own domain/subdomain pointing to your server, or else the SSL will not be issued.
Once installed, you should be able to test Authelia
# curl -I https://auth.example.com
You should see the Authelia login portal.
Step 10. Create Authelia Snippet
This snippet would be a reusable; let’s create it now.
# nano /etc/nginx/snippets/authelia-authrequest.conf
Paste these lines:
location = /internal/authelia/authz {
internal;
proxy_pass http://127.0.0.1:9091/api/authz/auth-request;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Real-IP $remote_addr;
}
auth_request /internal/authelia/authz;
auth_request_set $redirection_url $upstream_http_location;
error_page 401 =302 $redirection_url;
error_page 403 =403 /authelia-forbidden;
Save the file, then exit from the editor. We can also create a forbidden page.
# nano /etc/nginx/snippets/authelia-forbidden.conf
Insert the following:
location = /authelia-forbidden {
return 403 "Forbidden by Authelia access policy.\n";
}
Save the file and exit.
Step 11. Configure a Protected Website
For example, your application is running on port 3000. We can modify your application’s Nginx server block now.
# nano /etc/nginx/conf.d/app.yourdomain.conf
Paste these lines:
server {
listen 80;
server_name app.example.com;
include /etc/nginx/snippets/authelia-authrequest.conf;
include /etc/nginx/snippets/authelia-forbidden.conf;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Remote-User $upstream_http_remote_user;
proxy_set_header Remote-Groups $upstream_http_remote_groups;
proxy_set_header Remote-Email $upstream_http_remote_email;
proxy_set_header Remote-Name $upstream_http_remote_name;
}
}
Or, if you don’t have an application running on port 3000, you can create a simple NodeJS app for testing. For example, you can run the command below to create a test website.
docker run -d \
--name test-app \
--restart unless-stopped \
-p 127.0.0.1:3000:80 \
nginx:alpine
Restart nginx whenever we change its configuration files.
# systemctl restart nginx
We can also issue a free SSL certificate now.
# certbot --nginx -d app.yourdomain.com
You can now visit your application at https://app.yourdomain.com. Nginx asks Authelia whether the request is authorized. If you are not logged in, you will be redirected to https://auth.yourdomain.com. Then, after logging in, you enroll TOTP if needed. Finally, you will be redirected back to https://app.yourdomain.com.
Conclusion
That’s it! You have learned how to set up Authelia on Debian 13: Forward Auth with Nginx and Redis.
Of course, you don’t have to set up Authelia on Debian 13: Forward Auth with Nginx and Redis if you have an active Debian Hosting service with us, in which case you can simply ask our expert Linux administrators to set up Authelia on Debian 13: Forward Auth with Nginx and Redis for you for free. They are available 24×7 and will handle your request immediately.
If you liked this post about how to set up Authelia on Debian 13: Forward Auth with Nginx and Redis, please share it with your friends or leave a comment in the comments section below.
