Chapter 7 · 7.1
Uptime Kuma: monitor your sites and server
Uptime Kuma checks whether your websites, servers and certificates are working, and alerts you when something goes wrong. You manage it in your browser.
Each recipe builds on the working folder /srv/diensten with Caddy from Your working folder with compose.yaml, .env and Caddy. You add a service to compose.yaml, a block to the Caddyfile, and an A and AAAA record for the name (see A and AAAA records in My Domains).
1. DNS
Create an A and AAAA record for status.example.com pointing to your VPS.
2. compose.yaml
Add under services::
uptime-kuma:
image: louislam/uptime-kuma:2
restart: unless-stopped
volumes:
- uptime-kuma:/app/data
And under volumes: at the bottom:
uptime-kuma:
3. Caddyfile
status.example.com {
reverse_proxy uptime-kuma:3001
}
4. Start
anna@web1:/srv/diensten$ sudo docker compose up -d
anna@web1:/srv/diensten$ sudo docker compose exec -w /etc/caddy caddy caddy reload
Open https://status.example.com and create your admin account straight away, before someone else does.
5. What do you monitor?
| Monitor type | Example |
|---|---|
| HTTP(s) | Your website. Turn on the alert for an expiring certificate: Let's Encrypt no longer emails you about this. |
| TCP port | Whether SSH (22) on another server is reachable |
| Ping | Whether a server responds |
| Push | Your backup script calls an address when it finishes. If that signal doesn't arrive, you get an alert (see Backups with restic to another location). |
In the notification settings, choose how you want to be alerted, for example by email via a mailbox on port 587 (see Reverse DNS and sending mail from your VPS) or with an app on your phone.
Please note: Uptime Kuma on your own VPS can't alert you if that VPS itself is down. So also have your VPS monitored from the outside, from another server or with an external service (see Monitoring from outside and inside).
Backups and updates
Everything is stored in the volume uptime-kuma; include it in your backup (see Backing up databases and Docker volumes properly). You update it as described in Updating containers, cleaning up and limiting logs.
