Skip to content

Open-Source Tools, Uptime & Alerting

Uptime Kuma in Docker: a self-hosted status page in an evening

To run Uptime Kuma in Docker, one command is enough:

docker run -d --restart=unless-stopped -p 3001:3001 \
  -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2

Affiliate links: we may earn a commission. We also earn from qualifying purchases on eBay.

rack list

  • UGREEN NASSmall NAS boxes for lab backups, config archives and long graph history.Try UGREEN NAS

Browse to port 3001 on that host, create the admin account, and you are monitoring. Everything Uptime Kuma knows lives in /app/data, so that volume is the part to protect. At the time of writing the project recommends the 2 tag, with the 2.5 releases current; the latest tag is deprecated and still points at version 1, so keep it out of new installs. The project site, uptime.kuma.pet, links to the documentation wiki.

That gets you a dashboard. The rest of the evening turns it into something you can rely on: a Compose file, HTTPS behind a reverse proxy, the right monitors, notifications that reach a phone, a status page, and a backup you have restored. Uptime Kuma answers one question well: is it up, and tell me when it is not. For SNMP graphs and capacity planning you still want a full network monitor, and the Raspberry Pi home-lab build shows the two side by side on one board.

Where to run it

Three rules save trouble later.

  • Not on the thing it watches. A monitor on your only Proxmox host goes quiet exactly when that host dies. A small separate box, a Pi, or a small VPS outside the building works better.
  • Local storage only. The data folder holds a SQLite database by default, and the documentation warns that network file systems such as NFS are not supported because of file locking. Use a local directory or a Docker volume.
  • Full image or slim. The 2 image includes an embedded MariaDB and a Chromium for the browser-engine monitor; 2-slim drops both and is a few hundred megabytes smaller. Rootless tags exist too, but the project warns that some features (the Docker container monitor among them) need extra work there, and that they are a poor choice for an upgrade from version 1.

Uptime Kuma Docker Compose setup

For anything you plan to keep, use Compose. Create /opt/uptime-kuma/compose.yaml:

services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    container_name: uptime-kuma
    restart: unless-stopped
    ports:
      - "127.0.0.1:3001:3001"
    volumes:
      - ./data:/app/data
      # Only for Docker container monitors (this grants root-level access to Docker):
      # - /var/run/docker.sock:/var/run/docker.sock:ro

Then start it and watch the first boot:

cd /opt/uptime-kuma
docker compose up -d
docker compose logs -f
docker compose ps

Two choices differ from the project's sample file. The port is bound to 127.0.0.1, so only a reverse proxy on the same host can reach it; drop the address if you want direct LAN access for now. And the data is a plain folder beside the Compose file, which makes a backup one tar command instead of a hunt through /var/lib/docker. The image has a built-in health check, so docker compose ps reports it healthy once it is ready, which can take a minute or two on first start.

On the first visit, version 2 asks which database to use. SQLite is right for a home lab or a small office. The embedded MariaDB (full image only) or an external MariaDB or MySQL server suits bigger installs. The project does not support moving an existing SQLite install to MariaDB later, so decide now. Then create the admin account and switch on two-factor authentication in the security settings.

HTTPS through a reverse proxy

The Uptime Kuma interface runs over WebSockets, so the proxy must pass the Upgrade and Connection headers, and it needs its own hostname: a subdirectory such as /uptime is not supported. Caddy handles the headers and the certificate by itself:

status.example.net {
    reverse_proxy 127.0.0.1:3001
}

In nginx, spell the upgrade headers out inside the server block:

location / {
    proxy_pass         http://127.0.0.1:3001;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection "upgrade";
    proxy_set_header   Host $host;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
}

Once the proxy is the only way in, open Settings, then Reverse Proxy, and set Trust Proxy to Yes so logs show real client addresses. If the page loads but sits on a spinner, the WebSocket upgrade is not getting through, so check the proxy first. Behind Cloudflare, WebSockets must be enabled for the zone; the same settings page can also run a Cloudflare Tunnel from inside Kuma.

Monitors worth setting up first

Monitor type Use it for Note
HTTP(s) websites, APIs, admin pages can warn before the TLS certificate expires
HTTP(s) Keyword or JSON Query pages that return 200 while broken match a word or a JSON value, not only the status code
TCP Port SSH, SMTP, databases proves the port answers, not that the service works
Ping routers, switches, access points ICMP must be allowed from the Kuma host
DNS your resolvers and public records resolve a real name through a chosen server
Push backups, cron jobs Kuma waits for a call; silence is the alert
Docker Container containers on the same host needs the socket mounted
SNMP one OID, such as UPS battery status in the 2.x releases; no substitute for an NMS
Group a parent for related monitors one status for "the office network"

The comparison of ping, TCP and synthetic checks explains why a keyword check beats a bare ping for anything with a web front end.

Two settings matter on every monitor. The interval can go as low as 20 seconds, but 60 is plenty for most things. And new monitors in version 2 default to zero retries, so one dropped packet sends an alert; set one or two retries on anything reached over Wi-Fi or the internet.

The push monitor is the one people underuse. Kuma gives you a URL, the job calls it when it finishes, and if no call arrives within the heartbeat interval the monitor goes down:

#!/bin/sh
# last lines of a nightly copy job
rsync -a /srv/data/ backup01:/srv/backup/data/ || exit 1
curl -fsS -m 10 "https://status.example.net/api/push/AbC123xYz?status=up&msg=OK&ping=" >/dev/null

Notifications that reach someone

At the time of writing Uptime Kuma ships with 90 or more notification services, plus Apprise for the rest: SMTP email, ntfy, Gotify, Pushover, Telegram, Signal, Matrix, Discord, Slack, Microsoft Teams, webhooks and many more. Set them up under Settings, then Notifications:

  1. Add one channel that wakes you (a phone push such as ntfy or Pushover) and one that keeps a record (email or team chat).
  2. Press Test before saving. A notification that has never fired is a guess.
  3. Tick "Default enabled" so new monitors get it, and "Apply on all existing monitors" once.

Version 2 moved SMTP subject and body templates to LiquidJS, where variable names are case-sensitive, so templates carried over from version 1 may need edits. If the Kuma host reaches the internet only through a proxy, the NOTIFICATION_PROXY environment variable routes notifications through it.

Be choosy about what reaches a phone at night. A failed check on a test VM can go to email; the router and the NAS go to the phone. Alert fatigue covers the reasoning.

A status page people can read

Status pages are where Kuma beats bigger tools for small teams. Create one with a slug, say office, and it appears at /status/office. Add groups ("Internet", "Email", "File server"), drop monitors into them, and name things in plain language: "Shared drive (S:)" means more to colleagues than nas01:445. You can post incident notes on the page and schedule maintenance windows, which show on the page and hold back alerts for the monitors involved.

Three details from the documentation. The page caches results for about five minutes and reloads on the same cycle, so it is not a live dashboard. Each page can be mapped to its own domain if your proxy passes the Host header. And the uptime percentages it shows are only as honest as your checks; the uptime SLA calculator turns them into minutes of allowed downtime.

Backups and upgrades

Version 2 removed the old JSON export. Copying the data folder is the only supported backup, and with SQLite the safe way is to stop the container for the few seconds a copy takes:

#!/bin/sh
# /usr/local/bin/backup-uptime-kuma.sh
cd /opt/uptime-kuma || exit 1
docker compose stop uptime-kuma
tar -czf "/srv/backup/uptime-kuma-$(date +%F).tar.gz" data
rc=$?
docker compose start uptime-kuma
find /srv/backup -name 'uptime-kuma-*.tar.gz' -mtime +14 -delete
exit $rc

Run it from /etc/cron.d/uptime-kuma-backup with a line such as 15 3 * * * root /usr/local/bin/backup-uptime-kuma.sh. Copy the archives off the host, and restore one onto a spare machine at least once: unpack it into a new folder, point a Compose file at it, start the container. A backup you have never restored is a hope.

Upgrades follow the same pattern: back up, then pull and recreate.

cd /opt/uptime-kuma
docker compose pull
docker compose up -d --force-recreate

The 2 tag keeps you on the 2.x line; pin an exact release tag if you prefer to upgrade on purpose. Moving an old version 1 install to version 2 is a bigger step. The migration rewrites the heartbeat history and, by the project's own account, can take minutes or hours on slow hardware. Stop the container, back up, switch the tag, watch docker compose logs -f, and do not interrupt it.

Who watches the watcher

Uptime Kuma cannot tell you that it is down. Close the gap with a second Kuma at another site watching the first, or a check from your main monitoring system against https://status.example.net. Either one turns a silent failure into an alert.

The evening, as a checklist

  • Compose file in /opt/uptime-kuma, data in a local folder, port bound to 127.0.0.1.
  • Reverse proxy with WebSockets and HTTPS, Trust Proxy on, two-factor login.
  • Keyword checks for web services, ping for network gear, push monitors for scheduled jobs.
  • One or two retries per monitor, two notification channels, both tested.
  • A status page in words your colleagues use.
  • A nightly backup, copied off the host and restored once.
  • Something outside Kuma watching Kuma.

next: Uptime and SLA calculator for the numbers, the Rack list for the gear