Home Server › Containers

Monitoring homelab containers with Uptime Kuma v2 and Authelia

Deploy Uptime Kuma v2 across Docker networks to monitor PostgreSQL, Redis, Gitea, and Outline, with Authelia Forward Auth gating dashboard access.

Monitoring homelab containers with Uptime Kuma v2 and Authelia

When a shared database or identity container silently crashes in a homelab, every downstream app fails at once. Here is how I deployed Uptime Kuma v2 across three Docker networks to watch container lifecycles and internal ports while locking the dashboard behind Authelia Forward Auth.

Tested with Uptime Kuma v2 (louislam/uptime-kuma:2), Docker Compose, Nginx Proxy Manager, and Authelia Forward Auth.


Why Uptime Kuma v2 fits as a homelab control plane

In a multi-stack homelab, services depend tightly on each other:

  • If PostgreSQL or Redis goes down, Authelia, Gitea, and Outline all break together.
  • If LLDAP stalls, every SSO login across the domain fails.
  • If Nginx Proxy Manager fails to renew a TLS certificate, external access drops across every subdomain.

You want a lightweight monitor that catches both container exits and internal port failures within seconds. Uptime Kuma v2 (louislam/uptime-kuma:2) improves on v1 (which I covered in my earlier Uptime Kuma v1 guide) with a faster backend engine, cleaner notification pipelines, and better tag and status-page management—all in roughly 100 MB of RAM.

ToolPrimary strengthResource costBest fit
Uptime Kuma v2HTTP/TCP/Docker container probes + instant alerts + status pages~100 MB RAMFast up/down health checks and push notifications for homelabs
Prometheus + GrafanaTime-series metrics, CPU/RAM graphs, PromQL alerting~400–800 MB RAMDeep resource trends, latency histograms, and long-term observability
Docker HEALTHCHECK onlyLocal container restart triggers0 MB extraSelf-healing single containers without external alerting

When Uptime Kuma isn’t enough: Uptime Kuma tells you that a service is down or slow to respond, not why its heap or connection pool filled up. Pair it with Prometheus and Grafana if you also need historical resource metrics.


Multi-network topology and socket isolation

Because Uptime Kuma needs to probe internal database ports, CI services, and web endpoints without exposing those internal ports to the host or internet, I attach it to three isolated Docker networks:

  • proxy_network: Serves the dashboard at health.namju.kim through Nginx Proxy Manager and lets Uptime Kuma reach web apps on the proxy tier.
  • database_network: Runs direct TCP checks against postgres:5432 and redis:6379 over internal Docker DNS.
  • monitoring_network: Probes internal services such as Gitea and the Actions runner.
flowchart TD
    subgraph Ingress["External ingress"]
        Admin["Admin browser"] -->|"health.namju.kim"| NPM["Nginx Proxy Manager"]
        NPM -->|"Forward Auth (group:admin)"| Auth["Authelia"]
    end

    subgraph Monitoring["Monitoring stack (Docker Compose)"]
        NPM -->|"Authorized proxy"| UK["Uptime Kuma v2<br/>(port 3001)"]
        VolKuma[("uptime_kuma_data<br/>/app/data")]
        UK --- VolKuma
    end

    subgraph HostDocker["Host Docker daemon"]
        Sock["/var/run/docker.sock<br/>(:ro mount)"]
    end

    subgraph Targets["Monitored Docker networks"]
        NetDB["database_network<br/>(PostgreSQL, Redis)"]
        NetMon["monitoring_network<br/>(Gitea, Runner)"]
        NetProxy["proxy_network<br/>(NPM, Authelia, Outline)"]
    end

    UK -->|"Inspect container states"| Sock
    UK --> NetDB
    UK --> NetMon
    UK --> NetProxy

Uptime Kuma v2 Docker Compose configuration

Here is monitoring/docker-compose.yaml. It mounts the host Docker socket with :ro so Uptime Kuma can query container status directly, and joins all three external networks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# monitoring/docker-compose.yaml
name: monitoring

services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    container_name: uptime-kuma
    restart: unless-stopped
    environment:
      TZ: Asia/Seoul
    volumes:
      - uptime_kuma_data:/app/data
      # Mount host Docker socket to inspect container health states
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - proxy_network
      - monitoring_network
      - database_network

volumes:
  uptime_kuma_data:

networks:
  proxy_network:
    external: true
  monitoring_network:
    external: true
  database_network:
    external: true

Gating the dashboard with Authelia Forward Auth

A monitoring dashboard reveals internal container names, private hostnames, ports, and service topology. Even though Uptime Kuma has its own login form, I put Authelia Forward Auth in front of health.namju.kim so only group:admin users can reach the app at all.

In identity/authelia/configuration.yml, the ACL rule restricts health.namju.kim to admins:

1
2
3
4
5
6
7
8
# identity/authelia/configuration.yml (excerpt)
access_control:
  default_policy: deny
  rules:
    - domain: health.namju.kim
      subject:
        - "group:admin"
      policy: one_factor

Then, in Nginx Proxy Manager, create the health.namju.kim proxy host pointing to uptime-kuma:3001 (with Websockets Support enabled—Uptime Kuma’s UI relies on Socket.IO) and paste the two Authelia snippets into the Advanced tab:

1
2
include /snippets/authelia-location.conf;
include /snippets/authelia-authrequest.conf;

Unauthenticated users hitting health.namju.kim now get redirected straight to Authelia before a single byte reaches Uptime Kuma.


Core monitors and instant alerts

Once signed in, configure a layered set of monitors so you catch both dead containers and broken HTTP/TCP layers:

Monitor typeTargetCheck methodWhat it catches
Docker Containerpostgres, redis, lldap, authelia, gitea, outlineDocker socket inspectionContainer crashes, OOM kills, restart loops
HTTP(s)https://auth.namju.kim/api/healthHTTP 200 OKAuthelia API health and TLS validity
HTTP(s)https://git.namju.kim/api/v1/versionHTTP 200 OKGitea web server responsiveness
HTTP(s)https://outline.namju.kimHTTP 200 OKOutline Wiki availability
TCP Portpostgres:5432, redis:6379TCP handshakeInternal DB/cache port reachability
TCP Portgit.namju.kim:2222TCP handshakeExternal Git SSH port binding

Wiring up Telegram or Discord alerts

Under Settings → Notifications, add a Telegram bot token + chat ID (or a Discord webhook URL) and enable Default enabled on all new monitors. That way every new probe automatically sends push alerts within 1–2 seconds of a failure without having to remember to attach a notification channel each time.


Starting the stack and verifying network bindings

Create monitoring_network if it doesn’t exist yet, start Uptime Kuma, and verify all three network attachments:

1
2
3
4
5
6
7
8
9
# 1. Create the shared monitoring network (if missing)
docker network create monitoring_network

# 2. Start Uptime Kuma v2
docker compose up -d

# 3. Verify attached Docker networks
docker inspect uptime-kuma --format='{{range $net, $conf := .NetworkSettings.Networks}}{{$net}} {{end}}'
# Output: proxy_network monitoring_network database_network

Open https://health.namju.kim, sign in through Authelia, and confirm that every Docker container and HTTP/TCP monitor reports UP.


Production caveats and checklist

Important caveat about /var/run/docker.sock:ro: On Linux, mounting a Unix domain socket read-only (:ro) only prevents unlinking or modifying the socket file itself—it does not stop a process from sending write HTTP requests (POST/DELETE) to the Docker daemon over that socket. It is fine as a baseline in a single-admin homelab behind Authelia, but if you want true read-only API enforcement, put a proxy like tecnativa/docker-socket-proxy in front of the socket and expose only CONTAINERS=1.

Socket.IO and public status pages: If you expose a public status page on a separate URL later, remember that Authelia Forward Auth on the entire health.namju.kim domain will block anonymous visitors. Either add an Authelia bypass rule for /status/* and /assets/*, or keep status pages internal.

Before finishing your monitoring setup, check:

  • Websockets Support is enabled in Nginx Proxy Manager for health.namju.kim so live status updates don’t disconnect.
  • uptime_kuma_data is backed up alongside your other persistent volumes (it holds your SQLite database and monitor history).
  • Notification delivery is tested with the Test button in Uptime Kuma—and ideally verified by briefly stopping a non-critical test container.
  • All three external networks (proxy_network, monitoring_network, database_network) appear in docker inspect uptime-kuma.
This post is licensed under CC BY 4.0 by the author.