Uptime Kuma Ansible role https://uptimekuma.co/
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Conrad e83e6bb3bc
All checks were successful
Lint + Tag / format (push) Successful in 1m4s
Lint + Tag / tag (push) Successful in 1m2s
feat: added port expose, so alloy can scrape locally
2026-10-27 14:33:41 +01:00
.forgejo/workflows feat: added initial version 2026-10-12 16:00:58 +07:00
defaults feat: added port expose, so alloy can scrape locally 2026-10-27 14:33:41 +01:00
meta feat: added initial version 2026-10-12 16:00:58 +07:00
tasks feat: added initial version 2026-10-12 16:00:58 +07:00
templates feat: added port expose, so alloy can scrape locally 2026-10-27 14:33:41 +01:00
.gitignore feat: added initial version 2026-10-12 16:00:58 +07:00
CHANGELOG.md feat: added port expose, so alloy can scrape locally 2026-10-27 14:33:41 +01:00
LICENSE feat: added initial version 2026-10-12 16:00:58 +07:00
README.md feat: added port expose, so alloy can scrape locally 2026-10-27 14:33:41 +01:00

Uptime Kuma

Deploys Uptime Kuma 2 with SQLite via Docker Compose, routed through Traefik. Optionally puts oauth2-proxy in front of it for an OIDC login (Keycloak), since Uptime Kuma has no SSO of its own.

Requirements

  • Docker
  • community.docker Ansible collection
  • uptime_kuma_traefik: true needs an existing external traefik_web network

Variables

Variable Default Description
uptime_kuma_instance uptime-kuma Compose project name and container name prefix.
uptime_kuma_data_path /data/uptime-kuma SQLite database and uploads.
uptime_kuma_docker_path /docker/uptime-kuma Compose file.
uptime_kuma_version 2-slim louislam/uptime-kuma image tag.
uptime_kuma_domain ~ Required. Public domain, no protocol.
uptime_kuma_traefik true Traefik labels on Kuma, or on oauth2-proxy with SSO.
uptime_kuma_traefik_certresolver default Traefik certificate resolver.
uptime_kuma_extra_domains [] Further domains for the same instance, e.g. a status page's own domain, see Status page domains.
uptime_kuma_extra_certresolver http Traefik certificate resolver for uptime_kuma_extra_domains (HTTP challenge).
uptime_kuma_port ~ Exposes the same on 127.0.0.1:<port>.
uptime_kuma_local_port ~ Exposes Uptime Kuma itself on 127.0.0.1:<port>, also with SSO (bypasses oauth2-proxy), e.g. to scrape /metrics.
uptime_kuma_extra_hosts {} hostname: IP entries for both containers (SSO provider, own public names).
uptime_kuma_networks [] Further Docker networks Kuma joins (e.g. signal_api for Signal notifications). Created if missing.
uptime_kuma_sso_conf ~ OIDC login, see SSO.
uptime_kuma_oauth2_proxy_version v7.15.5 quay.io/oauth2-proxy/oauth2-proxy image tag.
uptime_kuma_uninstall false Stops and removes containers and the compose directory.
uptime_kuma_purge false Also removes the data directory. Requires uptime_kuma_uninstall: true. Irreversible.

SSO

With uptime_kuma_sso_conf set, oauth2-proxy takes all traffic and requires an OIDC login (PKCE S256). These stay public: status pages (/status/..., /api/status-page/...), badges (/api/badge/...), push monitors (/api/push/...) and the static files they load.

Key Required Default Description
issuer_url yes — e.g. https://auth.example.com/realms/<realm>
client_id yes — OIDC client ID.
client_secret yes — OIDC client secret.
cookie_secret yes — 16, 24 or 32 characters (openssl rand -hex 16).
groups_claim no groups Token claim checked against allowed_groups.
allowed_groups no unset Only users with one of these values get in. Unset: every user of the realm.

Redirect URI to register: https://<uptime_kuma_domain>/oauth2/callback.

Uptime Kuma itself only knows one local user. Once after the first deploy:

  1. Open the domain, log in through SSO, create the Uptime Kuma user (keep its password as break-glass access).
  2. Settings > Security > Disable Auth.

From then on the SSO login is the only one. Everyone allowed in shares that one Uptime Kuma account.

Status page domains

To serve a status page on its own domain (e.g. status.example.org for the page /status/example):

  1. Point the domain at the Traefik host and add it to uptime_kuma_extra_domains.
  2. In Uptime Kuma, add it under the status page's settings > Domain Names.

Uptime Kuma then serves that page at / of the domain. The extra domains get their certificates from uptime_kuma_extra_certresolver, which needs an HTTP challenge when they are outside the DNS zone of the main resolver. With SSO, / is public too (it's the same app shell as /status/...); the dashboard data still needs the login.

Notes

  • UPTIME_KUMA_DB_TYPE=sqlite skips the database setup screen. MariaDB isn't supported by this role.
  • The dashboard's live updates use a WebSocket, which oauth2-proxy passes through.
  • The rendered compose.yml is mode 0600 (client and cookie secret).