This role configures Shlink - an Open Source URL shortener.
A basic setup should look like:
shlink_domain: 'link.example.org'
shlink_admin_domain: 'admin-link.example.org'
shlink_fallback_url: 'https://example.org/'
shlink_db_pass: 'super-secret-password'Optional GeoLite2 for visit geolocation:
shlink_geolite_license_key: 'your-license-key'The admin interface is available under a separate domain, protected by the infra-role-oauth-proxy role.
Shlink supports multiple domains from a single instance. Domains are automatically detected from the HTTP Host header when creating short URLs.
To add a new domain (e.g. link.example.com):
- Terraform - Add Cloudflare DNS record pointing to the server
- Nginx - Add site config for the new domain with SSL certificate
- Vault - Ensure origin certificate exists for the domain
No Shlink configuration needed - the domain is automatically registered when the first short URL is created for it.
| Port | Service | Description |
|---|---|---|
{{ shlink_app_cont_port }} (8080) |
Shlink API | Main shortener service |
{{ shlink_web_cont_port }} (8090) |
Web Client | Admin UI (behind OAuth) |
{{ shlink_db_cont_port }} (5432) |
PostgreSQL | Database |
The service is deployed using:
- shlinkio/shlink - URL shortener
- shlinkio/shlink-web-client - Admin Web UI
- postgres (16-alpine) - Database
infra-role-oauth-proxy- Protects admin UI with Keycloak authenticationinfra-role-nginx- Reverse proxy / SSL terminationinfra-role-restic-backups- Database backupsinfra-role-systemd-timer- Scheduled DB dumpsinfra-role-consul-service- Service discovery