# Self-host Authelia

> Single sign-on and two-factor portal. The admin user is created at first boot from a generated password (visible in the service environment settings, never on a process command line); more users go in /data/users.yml. Sessions are scoped to this portal's own host, so widen the cookie domain in /config/configuration.yml before protecting other apps. One-time codes are written to /data/notification.txt.

- Page: https://levelrail.com/templates/authelia/
- JSON: https://levelrail.com/templates/authelia.json
- Category: Security
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/authelia/authelia
- Upstream docs: https://www.authelia.com/configuration/prologue/introduction/

## Requirements
- Memory: about 256 MiB
- amd64: published, arm64: tested
- Needs configuration before start: no
- Pinned image tag: 4.39.28

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| authelia | authelia/authelia | 4.39.28 | 9091 | data -> /data; config -> /config |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| authelia | ADMIN_PASSWORD | generated |
| authelia | AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET | generated |
| authelia | AUTHELIA_SESSION_SECRET | generated |
| authelia | AUTHELIA_STORAGE_ENCRYPTION_KEY | generated |
| authelia | PORTAL_URL | preset |
| authelia | X_AUTHELIA_CONFIG_FILTERS | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy authelia --name my-authelia
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/authelia/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Authelia on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id authelia for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image authelia/authelia:4.39.28 is what you deploy there.

Self-host Authelia, Authelia docker compose file, deploy Authelia on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
