Deployment guide

Authelia

Overview

Authelia is an open-source authentication and authorization server that provides single sign-on and multi-factor authentication through a login portal. Used as a forward-auth provider in front of nginx or Traefik, it protects your web applications with first-factor (password) and second-factor (TOTP, WebAuthn, Duo) authentication, access-control rules and brute-force regulation.

This SecureAnyCloud image installs Authelia 4.39.20 and runs it as a systemd service bound to loopback, behind an nginx reverse proxy on port 80. The database lives on a dedicated Azure data disk, and every VM generates its own unique secrets and admin user on first boot.

What you get:

  • Authelia 4.39.20 (binary /usr/bin/authelia) with a file user backend and SQLite storage
  • nginx on :80 as a reverse proxy to the loopback Authelia portal, with no extra authentication layer in front of it, because Authelia is the authentication
  • Per-VM secrets (JWT, session, storage encryption) and an argon2id-hashed admin user, generated on first boot
  • A dedicated Azure data disk at /var/lib/authelia for the database and notifications
  • authelia.service and nginx.service as enabled, active systemd units
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting size.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp.

Authelia is domain-based. You need a DNS name and, for production, TLS termination in front of it.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Authelia by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:authelia-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name authelia \
  --image sac1647283583153:authelia-ubuntu-24-04:default:latest \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name authelia --port 80 --priority 1010

Step 3 - Connect to your VM

SSH in as azureuser using the public IP address of the VM:

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Check that Authelia and nginx are active:

systemctl is-active authelia.service nginx.service

Both report active. On first boot, Authelia generates its secrets and an admin user.

Step 5 - Retrieve your admin password

Your VM generates a unique admin password on first boot and writes it to a root-only file. Read it with sudo:

sudo cat /root/authelia-credentials.txt

The file contains AUTHELIA_ADMIN_USER (admin) and AUTHELIA_ADMIN_PASSWORD. Store the password somewhere safe.

Step 6 - Set your domain (required)

Authelia is domain-based, and the image ships with the sample domain example.com. Edit /etc/authelia/configuration.yml and set your domain in session.cookies[].domain. Set session.cookies[].authelia_url to the public HTTPS URL of the portal, for example https://auth.yourdomain.com. Then restart Authelia:

sudo nano /etc/authelia/configuration.yml
sudo systemctl restart authelia

For production, terminate TLS in front of Authelia, because the cookies require HTTPS. See Protecting your apps.

Step 7 - Open the login portal

Browse to your Authelia URL and sign in as admin with the password from Step 5.

The portal also offers a password reset flow and, once you enable it, second-factor registration (TOTP, WebAuthn).

Step 8 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint for load balancers and probes. Query it:

curl -s http://localhost/health

The endpoint returns ok.

Step 9 - Verify authentication from the command line

Authelia's first-factor API rejects a wrong password and accepts the per-VM admin password. Post the admin credentials to it:

curl -s -X POST -H 'Content-Type: application/json' -H 'Host: auth.example.com' -H 'X-Forwarded-Proto: https' -d '{"username":"admin","password":"<AUTHELIA_ADMIN_PASSWORD>","keepMeLoggedIn":false}' http://localhost/api/firstfactor; echo

The API returns {"status":"OK"}. Replace auth.example.com with your configured domain.

Step 10 - Confirm state lives on the dedicated disk

The Authelia database is stored on the dedicated Azure data disk, so it survives OS changes and can be resized independently. Confirm the mount:

findmnt /var/lib/authelia

The mount is backed by a separate Azure data disk that is captured into the image and re-provisioned on every VM.

Protecting your apps

Authelia is a forward-auth provider. Put it behind your TLS-terminating reverse proxy (nginx or Traefik). Add an auth_request (nginx) or forwardAuth middleware (Traefik) that sends requests to Authelia's /api/authz/forward-auth endpoint.

Authelia then enforces your access_control rules. It redirects unauthenticated users to the portal and adds identity headers for your apps.

Add users to /etc/authelia/users_database.yml, hashing passwords with authelia crypto hash generate argon2. Enable TOTP or WebAuthn for second-factor protection.

Maintenance

  • Users: edit /etc/authelia/users_database.yml and hash passwords with authelia crypto hash generate argon2.
  • Backups: snapshot the /var/lib/authelia data disk to back up the database.
  • Configuration: all settings are in /etc/authelia/configuration.yml. Run sudo systemctl restart authelia after changes.
  • Upgrades: install a newer Authelia .deb package and restart the service.
  • Security patches: unattended-upgrades stays enabled, so the OS continues to receive security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Email sales@secureanycloud.com.

Deploy on Azure

Launch Authelia on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure