Uptime Kuma is a small self-hosted status monitor: it checks your websites, APIs, ports, DNS records and cron jobs, and alerts you when something stops answering. It has a clean web UI, dozens of notification channels and a public status page feature. This guide sets it up on an Ubuntu 24.04 or Debian 12 VPS with Docker Compose, keeps the container off the public internet, and puts Caddy in front for automatic HTTPS.
One rule before you start: run your monitor somewhere other than the things it monitors. If Uptime Kuma lives on the same VPS as your website, it goes down with it and tells you nothing.
1. Install Docker Engine from Docker's repository
The docker.io package in the distro archive works, but Docker's own repository gives you current releases and the docker compose v2 plugin. This follows the official instructions at docs.docker.com and works on both Ubuntu and Debian:
sudo apt update sudo apt install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings . /etc/os-release sudo curl -fsSL "https://download.docker.com/linux/$ID/gpg" -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$ID $VERSION_CODENAME stable" \ | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker compose version 2. The Compose file: bind to 127.0.0.1
Here is the part many tutorials get wrong. Ports published by Docker bypass ufw. Docker writes its own firewall rules, so ports: "3001:3001" makes the dashboard reachable from the whole internet even if ufw says port 3001 is closed. Bind the port to localhost and let the reverse proxy be the only way in.
sudo mkdir -p /opt/uptime-kuma cd /opt/uptime-kuma sudo nano 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 Start it and check that it only listens on localhost:
sudo docker compose up -d sudo docker compose logs -f --tail=50 # Ctrl+C to leave sudo ss -ltnp | grep 3001 # should show 127.0.0.1:3001 The :2 tag follows the 2.x release line, so docker compose pull gets fixes without jumping to a new major version by surprise.
3. Caddy in front, with automatic HTTPS
Point a DNS record such as status.example.com (A, and AAAA if you use IPv6) at the VPS first. Caddy needs it to get a certificate.
sudo apt install -y caddy sudo nano /etc/caddy/Caddyfile status.example.com { encode zstd gzip reverse_proxy 127.0.0.1:3001 } sudo caddy validate --config /etc/caddy/Caddyfile sudo systemctl reload caddy sudo ufw allow 80/tcp sudo ufw allow 443/tcp Caddy handles WebSockets on its own, which the Uptime Kuma UI depends on. Open https://status.example.com, create the admin account immediately (the first visitor gets to create it), and turn on two-factor authentication under Settings > Security.
If you would rather not expose the dashboard at all, skip Caddy and reach it through an SSH tunnel:
ssh -L 3001:127.0.0.1:3001 user@your-vps # then open http://localhost:3001 on your own machine 4. Monitor types worth using
Uptime Kuma has many monitor types. These cover most real setups:
| Type | Use it for | Tip |
|---|---|---|
| HTTP(s) | websites, APIs | Set an expected status code; turn on certificate expiry alerts |
| HTTP(s) - Keyword | pages that return 200 even when broken | Check for a word that only appears when the app works |
| HTTP(s) - Json Query | health endpoints | Assert a field, e.g. status equals ok |
| TCP Port | SSH, databases, mail, game servers | Proves something accepts connections |
| Ping | raw reachability | ICMP may be filtered; combine with a TCP check |
| DNS | your domain's records | Catches expired domains and broken DNS changes |
| Push | cron jobs, backups, bots | The job calls a URL; silence means failure |
The Push monitor deserves a closer look, because it watches things that have no port. Create a Push monitor with a heartbeat interval a bit longer than the job's schedule, copy its URL, and call it at the end of the job:
#!/bin/sh set -e /usr/local/sbin/backup.sh curl -fsS -m 10 --retry 3 "https://status.example.com/api/push/AbCdEf123?status=up&msg=OK" > /dev/null Because set -e stops the script when the backup fails, the push never happens, and Uptime Kuma alerts you when the heartbeat is missed. This catches the most dangerous kind of failure: the backup that silently stopped weeks ago.
5. Alerts that reach you
Under Settings > Notifications, add at least one channel before you add monitors, and tick "Default enabled" so new monitors use it. Popular options are Telegram, Matrix, Discord, Slack, email (SMTP), and ntfy for push notifications to a phone. Press Test on every channel. An alert channel you have never tested is a guess.
Sensible defaults to avoid alert fatigue:
- Heartbeat interval 60 seconds for important services, 300 for the rest.
- Retries set to 2 or 3, so a single lost packet does not wake you up.
- Resend notification every N heartbeats if the service stays down, so a missed alert is not the only one.
6. Status pages
Status Pages lets you publish a public page showing selected monitors, for example on status.example.com/status/main. Choose carefully what goes on it: it is public, so show service names, not internal hostnames, IP addresses or port numbers.
7. Updates and backups
Update by pulling the new image and recreating the container:
cd /opt/uptime-kuma sudo docker compose pull sudo docker compose up -d sudo docker image prune -f All state, including monitors, history, users and notification settings, lives in ./data. Before a major upgrade, and as part of your normal backups, stop the container for a consistent copy:
cd /opt/uptime-kuma sudo docker compose stop sudo tar czf /var/backups/uptime-kuma-$(date +%F).tar.gz data sudo docker compose start Settings > Backup also offers an export, but the data folder is the complete picture. Copy the archive off the server, the same way you copy every other backup.
Where to run it
A monitor needs very little: Uptime Kuma runs comfortably on the smallest VPS plans. What matters is that it sits on a different machine, ideally in a different location, from what it watches. I work with PhantomVPS, which publishes its own guide to Uptime Kuma on a VPS; its VPS plans come with root access and can be paid in crypto, with sign-up needing only an email address, a password and a nickname.
Checklist
- [ ] Monitor runs on a different server from what it monitors
- [ ] Port bound to
127.0.0.1, reachable only through Caddy or an SSH tunnel - [ ] Admin account created right away, 2FA on
- [ ] At least one notification channel, tested
- [ ] Push monitors on backups and cron jobs
- [ ]
./dataincluded in off-server backups

