This repository contains the infrastructure code to build authentik appliance images for various cloud providers. Currently supported:
- DigitalOcean Droplet Images
The authentik appliances project uses HashiCorp Packer and Ansible to create pre-configured virtual machine images with authentik pre-installed and ready to use. These images simplify the deployment process for users who want to run authentik on cloud platforms.
The project consists of the following components:
- Packer Configuration:
digitalocean.pkr.hcl
defines the build process for DigitalOcean droplet images. - Ansible Roles: The
goauthentik.appliance
role configures the system and installs authentik. - CI/CD Pipeline: GitHub Actions workflow in
.github/workflows/build-do.yml
automates the build process.
The build process follows these steps:
- Packer creates a new virtual machine instance on the target platform (e.g., DigitalOcean)
- Ansible provisions the instance with Docker and other dependencies
- The authentik application is installed via Docker Compose
- System configurations are applied (firewall, MOTD, etc.)
- The instance is converted to an image/snapshot
The following environment variables are used during the build process:
AUTHENTIK_VERSION
: The version of authentik to installDIGITALOCEAN_TOKEN
: API token for DigitalOcean (required for building DO images)
- Python 3.12
- uv (Python package manager)
- HashiCorp Packer
- Clone this repository
- Install dependencies:
uv venv uv sync
- Install Ansible roles:
uv run ansible-galaxy install -p ./roles -r requirements.yml
- Initialize Packer:
packer init .
To build a DigitalOcean image:
packer build -var "authentik_version=2025.6.1" digitalocean.pkr.hcl
- The authentik secret key is generated at boot time in the 001_onboot script using pwgen