Deployment guide

Authentik

Overview

Authentik is an open-source identity provider and single sign-on (SSO) platform, and a self-hosted alternative to Okta, Auth0 and Keycloak. It centralises authentication for your applications and users with SAML, OAuth2/OIDC and LDAP. It also offers a flexible flow engine for login, enrollment and recovery, an outpost model for proxying and protecting applications, and a full admin interface and REST API.

This SecureAnyCloud image installs the official Authentik self-host Docker Compose stack, pinned to Authentik 2026.5.3. The server container serves the web UI, flows and REST API directly on port 80. The worker container runs migrations and background tasks, and a PostgreSQL 16 database stores your data. Every secret is rotated on the first boot of every VM: the PostgreSQL password, the Authentik secret key, and the akadmin bootstrap password and API token. A fresh akadmin superuser is seeded on a clean database, and all stateful data lives on a dedicated Azure data disk.

What you get:

  • The official Authentik 2026.5.3 self-host stack running under Docker (the server and worker containers plus PostgreSQL 16), pinned via AUTHENTIK_TAG so it never upgrades silently
  • The Authentik server publishing its web UI, flows and REST API on :80 (and HTTPS on :443), with no extra nginx layer because Authentik handles its own routing
  • An unauthenticated readiness endpoint (/-/health/ready/) and liveness endpoint (/-/health/live/) for load balancers and probes
  • A per-VM akadmin superuser generated on first boot, with a unique password and API token recorded in a root-only file, so every VM is secured independently
  • Docker's data-root relocated onto a dedicated 40 GiB Azure data disk at /var/lib/authentik, so the PostgreSQL volume, the Compose project, the media and the certificates survive OS changes and can be resized independently
  • The whole stack managed as one authentik.service systemd unit, plus docker.service, both enabled
  • PostgreSQL bound to the internal Docker network only, so just 22/tcp (SSH) and 80/tcp (Authentik HTTP) are exposed
  • 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_B4ms (4 vCPU / 16 GiB RAM) is the recommended starting size, because the multi-container Authentik stack needs the memory.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp. Authentik serves plain HTTP on port 80, so for production, put it behind your own domain and TLS.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Authentik 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:authentik-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name authentik \
  --image sac1647283583153:authentik-ubuntu-24-04:default:latest \
  --size Standard_B4ms \
  --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 authentik --port 80 --priority 1010

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the stack is running

The Authentik containers run under Docker as a Compose stack, managed by a single systemd unit. On first boot the stack rotates every secret, recreates itself on a fresh database and seeds the akadmin superuser. The multi-container stack can take a couple of minutes to become fully healthy after the VM is created.

systemctl is-active authentik.service

The command reports active. List the running containers with:

sudo docker compose -f /var/lib/authentik/docker-compose.yml ps

The whole stack is one systemd unit. Use sudo systemctl status authentik and sudo systemctl restart authentik to control every container together.

Step 5 - Retrieve your per-VM admin credentials

Your VM generates a unique akadmin password and API token on first boot and writes them to a root-only file. Read it with:

sudo cat /root/authentik-credentials.txt

The file contains authentik.admin.username (akadmin), authentik.admin.email (admin@sac.local), AUTHENTIK_ADMIN_PASSWORD (for the web UI) and authentik.bootstrap.token (a Bearer token for the REST API). Store these values somewhere safe.

Step 6 - Confirm the health endpoint

The Authentik server exposes an unauthenticated readiness endpoint. It answers once the database has migrated and the server is ready, which makes it ideal for load balancer probes:

curl -s -o /dev/null -w 'ready -> HTTP %{http_code}\n' http://localhost/-/health/ready/

The endpoint returns HTTP 204. The web UI is served by the same server on port 80:

curl -s -o /dev/null -w 'UI -> HTTP %{http_code}\n' http://localhost/

The UI returns HTTP 200, or a 302 redirect into the login flow.

Step 7 - Confirm the admin API round-trip

The akadmin bootstrap API token from Step 5 authenticates against the Authentik REST API. Replace <token> with the token from your credentials file. Then confirm that a valid token is accepted and a wrong one is rejected:

TOKEN=<token> curl -s -o /dev/null -w 'good -> HTTP %{http_code}\n' \
  -H "Authorization: Bearer ${TOKEN}" \
  http://localhost/api/v3/core/users/me/ curl -s -o /dev/null -w 'bad -> HTTP %{http_code}\n' \
  -H 'Authorization: Bearer wrong-token-xyz' \
  http://localhost/api/v3/core/users/me/

A valid token returns HTTP 200. A wrong token returns HTTP 403. This confirms that the per-VM akadmin superuser was seeded and that API authentication is enforced.

Step 8 - Sign in to the web UI

Browse to http://<vm-public-ip>/ and sign in with the username akadmin and the password from Step 5. Authentik presents its authentication flow: enter the username, then the password.

After you sign in, open the admin interface at http://<vm-public-ip>/if/admin/. The dashboard shows overall system status, workers, recent events and quick actions.

Under Applications, register the external applications that use Authentik as their identity provider. Under Providers, configure the protocol (SAML, OAuth2/OIDC, LDAP or Proxy) that each application uses.

Under Directory -> Users, manage user accounts, groups and tokens. The akadmin superuser is listed here.

Step 9 - Confirm data lives on the dedicated disk

Docker's data-root is relocated onto the dedicated Azure data disk. The PostgreSQL database volume, the Compose project, the media and the certificates all live there and survive OS changes:

findmnt /var/lib/authentik

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

sudo docker info -f '{{.DockerRootDir}}'

The command prints /var/lib/authentik/docker.

Creating your first application

Authentik connects your applications to a single identity source. In the admin interface:

  • Open Applications -> Providers and create a provider for your protocol, for example an OAuth2/OIDC provider for a web app or a SAML provider for an enterprise service.
  • Open Applications and create an application bound to that provider. Give it a name and slug.
  • Assign access with a policy or group binding.
  • Point your application's SSO configuration at Authentik's issuer/metadata URL.

See the Authentik documentation for protocol-specific setup and the full flow, stage and outpost model.

Maintenance

  • Admin credentials: the per-VM akadmin superuser is in /root/authentik-credentials.txt. Change the password from the user settings in the web UI after your first sign-in.
  • Data: the PostgreSQL volume, the Compose project and the media all live on the /var/lib/authentik data disk (Docker data-root). Snapshot or resize that disk for backups.
  • Stack: manage the whole stack with sudo systemctl <status|restart|stop> authentik, or manage individual containers with sudo docker compose -f /var/lib/authentik/docker-compose.yml <ps|logs|restart>.
  • TLS: Authentik serves plain HTTP on port 80. Front it with your own domain and TLS for production.
  • Security patches: unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.

Support

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

Deploy on Azure

Launch Authentik 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