Uptime Kuma is a free, self-hosted monitoring tool: it checks your websites, servers and ports at an interval and alerts you when one stops answering. It runs well on a small VPS. This guide uses Docker (see Docker on a VPS first). Run the monitor on a different server than the one it watches, otherwise it goes down together with it. If you are logged in as root, leave out sudo.
sudo mkdir -p /opt/uptime-kuma && cd /opt/uptime-kuma
sudo nano compose.yaml
services:
uptime-kuma:
image: louislam/uptime-kuma:2
volumes:
- ./data:/app/data
ports:
- "127.0.0.1:3001:3001"
restart: unless-stopped
The port is bound to 127.0.0.1 so it is not exposed to the internet directly. Start it:
sudo docker compose up -d
sudo docker compose logs -f
Press Ctrl+C to leave the log; the container keeps running.
Follow nginx reverse proxy with HTTPS and use this location block, which also passes the WebSocket connection Uptime Kuma needs:
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;
proxy_set_header X-Forwarded-Proto $scheme;
}/opt/uptime-kuma/data folder: see backups with restic.sudo docker compose pull && sudo docker compose up -d.The smallest plan (1 vCPU, 2 GB RAM) is plenty: Fast VPS from $7.99 a month.
What does Uptime Kuma do?
It checks your websites, servers and ports at an interval and alerts you by email, Telegram, Discord and other channels when one stops answering.
Which server should run Uptime Kuma?
A different one from the servers it watches; otherwise the monitor goes down together with them.
Why does nginx need the Upgrade headers?
Uptime Kuma's web interface uses WebSocket connections, so nginx must pass the Upgrade and Connection headers.
How do I update Uptime Kuma?
Run docker compose pull and docker compose up -d in its folder, and keep a backup of the data folder.