This tutorial installs Uptime Kuma 2.5.13 on an Ubuntu 24.04 VPS with Docker Compose and places it behind Caddy 2.11.9 with automatic HTTPS. Only ports 80 and 443 stay open on the host: Uptime Kuma's port 3001 is never published. The guide covers the 2.x first-boot database setup screen, admin onboarding, monitors (HTTP keyword, TLS certificate expiry, TCP port, and cron Push heartbeats), alerts, consistent SQLite WAL backups, a verified restore, and controlled upgrades. Everything was tested on December 4, 2026 on a clean Ubuntu 24.04.5 LTS (amd64) machine.
On this page
- Where to host Uptime Kuma
- Versions used
- What you need
- 1. Install Docker and configure the firewall
- 2. Create .env, Caddyfile, and docker-compose.yml
- 3. Validate, start, and verify exposed ports
- 4. Pick the database (2.x), create the admin, and enable Trust Proxy
- 5. Set up alerts before adding monitors
- 6. Create the three monitor types that catch real failures
- 7. Consistent backup and tested restore
- 8. Controlled upgrades
- Common issues
- What was outside the test
- Next steps

Where to host Uptime Kuma
One operational rule matters before you start: do not rely solely on an Uptime Kuma instance running on the same VPS as the critical apps it monitors. If that server loses power, runs out of RAM, or drops off the network, Uptime Kuma goes down with it and no alert fires.
The cleaner setup is running Uptime Kuma on a separate small Linux VPS and monitoring your production websites, APIs, databases, and cron jobs from outside. If you only have one server right now, it is still useful for watching TLS certificates, webhooks, and external dependencies until you split monitoring onto its own box.
Versions used
| Component | Version | Source |
|---|---|---|
| Uptime Kuma | 2.5.13 (Dec 1, 2026) |
Uptime Kuma releases |
| Caddy | 2.11.9 (Nov 5, 2026) |
Caddy releases |
| BusyBox (volume backup) | 1.37.0 |
Docker Hub |
| Docker Engine | 29.10.1 |
official apt repository |
| Docker Compose | v5.8.1 (plugin) |
official apt repository |
| OS | Ubuntu 24.04.5 LTS, amd64 |
Every image tag is pinned. Avoid :2 or :latest: the 2.x branch changed database initialization compared to 1.x, and the tool responsible for alerting you during outages should never upgrade itself unexpectedly.
What you need
- A 64-bit Ubuntu 24.04 VPS with a
sudouser (examples usedeploy). If the server is brand new, start with First steps to secure an Ubuntu 24.04 VPS. - A subdomain with an
ADNS record pointing to the VPS IPv4 address. Examples usestatus.example.com. - Ports
80and443free on the VPS so Caddy can issue and renew the Let's Encrypt certificate.
In testing, Uptime Kuma used about 155 MiB of RAM at idle (166 MiB with three active monitors) and Caddy used 62 MiB, roughly 230 MiB combined. The stack fits comfortably on any Docker VPS tier.
1. Install Docker and configure the firewall
If Docker is not installed yet, set up the official docker.sources repository (covered in detail in How to install Docker and Docker Compose on Ubuntu 24.04):
sudo apt-get update
sudo apt-get install -y ca-certificates curl ufw
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources >/dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker "$USER"Log out of SSH and log back in so the docker group takes effect, then verify both versions:
docker version --format '{{.Server.Version}}'
docker compose versionAllow only SSH, HTTP, and HTTPS (TCP plus UDP for Caddy HTTP/3) in ufw:
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 443/udp
sudo ufw enable
sudo ufw status verboseConfirm with y when ufw enable prompts. Port 3001 stays out of ufw, and just as importantly stays out of ports: in Compose, because published Docker ports bypass ufw (see The Docker port stays open with ufw).
2. Create .env, Caddyfile, and docker-compose.yml
Create the project folder:
mkdir -p ~/uptime-kuma && cd ~/uptime-kumaSet your domain in .env (replace status.example.com with your subdomain):
UPTIME_DOMAIN=status.example.comCreate Caddyfile. Caddy requests the Let's Encrypt certificate, redirects HTTP to HTTPS with 308 Permanent Redirect, and proxies both HTTP requests and Socket.IO WebSockets without extra headers:
{$UPTIME_DOMAIN} {
reverse_proxy uptime-kuma:3001
}Create docker-compose.yml. Only caddy defines ports:; uptime-kuma lives exclusively on the internal proxy network:
name: uptime-kuma
services:
uptime-kuma:
image: louislam/uptime-kuma:2.5.13
restart: unless-stopped
volumes:
- uptime_kuma_data:/app/data
networks:
- proxy
caddy:
image: caddy:2.11.9
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
environment:
UPTIME_DOMAIN: ${UPTIME_DOMAIN:?set UPTIME_DOMAIN in .env}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks:
- proxy
depends_on:
- uptime-kuma
networks:
proxy:
volumes:
uptime_kuma_data:
caddy_data:
caddy_config:3. Validate, start, and verify exposed ports
Validate both configuration files before starting the stack:
cd ~/uptime-kuma
docker compose config -q && echo CONFIG_OK
docker run --rm --env-file .env -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2.11.9 caddy validate --config /etc/caddy/CaddyfileThe second command must end with Valid configuration. Bring the containers up and check status:
docker compose up -d
docker compose psIn docker compose ps, caddy binds 0.0.0.0:80->80/tcp and 0.0.0.0:443->443/tcp (plus 443/udp), while uptime-kuma lists only 3001/tcp (container-internal, no host binding) and transitions to (healthy) within about a minute.
Confirm on the host that port 3001 is not listening:
sudo ss -tulpn | grep -E ':(22|80|443|3001)\b'Only SSH on 22 and docker-proxy on 80 and 443 should appear. Check the HTTP-to-HTTPS redirect and initial entry endpoint:
curl -sSI http://status.example.com/ | head -n 5
curl -fsS https://status.example.com/api/entry-pageExpect HTTP/1.1 308 Permanent Redirect to https://status.example.com/ and:
{"type":"setup-database"}4. Pick the database (2.x), create the admin, and enable Trust Proxy
Unlike the 1.x series, Uptime Kuma 2.5.13 opens with a database selection step. Until you finish setup and create the administrator, anyone reaching your subdomain can claim the instance; complete this immediately after docker compose up -d:
- Open
https://status.example.comin your browser. - On Setup Database, select Embedded SQLite and continue. For dozens or hundreds of monitors on a VPS, embedded SQLite is fast, easy to back up, and avoids a separate database container. External MariaDB only becomes useful when thousands of monitors write heartbeats concurrently.
- Wait a few seconds while Uptime Kuma writes
db-config.json, createskuma.db, and runs database migrations. The page reloads automatically to the admin account screen. - Enter a username and a strong password (saved in a password manager), then click Create.
To confirm from the terminal that Socket.IO WebSocket handshakes pass cleanly through Caddy after database setup:
curl -fsS "https://status.example.com/socket.io/?EIO=4&transport=polling" | head -c 120The output begins with 0{"sid":"...","upgrades":["websocket"]....
Finish with two quick hardening tweaks in the UI:
- Trust Proxy: go to Settings → Reverse Proxy, enable Trust Proxy, and save. Without it, Uptime Kuma logs Caddy's internal Docker IP (such as
172.18.0.3) instead of the visitor's real client IP. - 2FA: under Settings → Security, turn on TOTP two-factor authentication for the admin account.
5. Set up alerts before adding monitors
Configuring a default notification channel first means every monitor you add inherits alerting automatically.
Open Settings → Notifications → Setup Notification. Uptime Kuma ships with over 90 built-in providers; on a VPS, four cover most setups:
- Telegram: create a bot via
@BotFather, paste theBot Token, send a message to the bot, and click Auto Get to fill Chat ID. Fast and reliable for solo ops or small team groups. - Discord or Slack: paste an Incoming Webhook URL for your alerts channel.
- Email (SMTP): solid secondary channel and handy for certificate expiry reminders.
- Generic Webhook (JSON): useful for feeding n8n workflows, custom scripts, or internal incident routing.
For whichever channel you pick:
- Enable Default enabled and Apply on all existing monitors.
- Click Test and confirm the test alert arrives before saving.
In our test against a local Webhook receiver, Test returned Sent Successfully. and stopping then restarting the monitored target triggered both JSON alerts automatically:
[TCP Demo 8080] [🔴 Down] Connection failed
[TCP Demo 8080] [✅ Up] 1 ms6. Create the three monitor types that catch real failures
Click Add New Monitor. On a production VPS, three monitor types catch almost everything that silently breaks:
HTTP(S) Keyword monitor with TLS certificate expiry alerts
Checking only for HTTP 200 misses error pages served with status 200 or an API returning an empty body. Use HTTP(s) - Keyword:
- URL: your app's health endpoint, such as
https://api.example.com/health. - Keyword: a string that only appears in a valid response (for example
ok). - Heartbeat Interval:
60seconds for standard websites, or20to30seconds for critical APIs. - Retries:
2or3with a20-second retry interval to filter out brief network blips or container restarts during deploys. - Certificate Expiry Notification: keep enabled. Uptime Kuma inspects the TLS certificate and alerts at 7, 14, or 21 days (configurable in Settings → Notifications) if automatic renewal stops working.
TCP Port monitor
For non-HTTP services (SSH on another server, an SMTP relay, or a database/Redis port over a private VPN), create a TCP Port monitor with the hostname and port.
Push monitor for cron jobs and backups
Knowing your website responds does not prove your nightly backup actually ran. Create a Push monitor:
- Set the Heartbeat Interval to match your schedule (for example
86400seconds for a daily backup, plus a small buffer). - Copy the generated Push URL and append a
curlping to your cron script so it only fires on success (&&):
/usr/local/bin/my-backup.sh && \
curl -fsS -m 10 "https://status.example.com/api/push/YOUR_TOKEN?status=up&msg=OK&ping=" >/dev/nullIn our test through Caddy over HTTPS, the Push call returned {"ok":true}. Once the interval elapsed without another heartbeat, Uptime Kuma fired:
[Backup Diario] [🔴 Down] No heartbeat in the time windowIf you follow Automatic VPS backups with restic, adding this Push ping at the end of the systemd unit guarantees an alert if backups ever stop running quietly.
Public status pages and Prometheus metrics
- Status page: under Status Pages → New Status Page, publish a clean public URL (such as
https://status.example.com/status/production) exposing only selected monitors while keeping the admin panel private. - Prometheus metrics (
/metrics): enabled and auth-protected by default (unauthenticated requests return401). Scrape it with Basic Auth or create an API key under Settings → API Keys:
curl -fsS -u "admin:YOUR_PASSWORD" https://status.example.com/metrics | grep '^monitor_status'7. Consistent backup and tested restore
Uptime Kuma runs SQLite in WAL mode: while the container is running, recent writes live in /app/data/kuma.db-wal and /app/data/kuma.db-shm. Copying kuma.db live without pausing can produce a broken backup.
The cleanest Docker volume backup pauses uptime-kuma for a few seconds (letting SQLite flush the WAL cleanly), archives all of /app/data (kuma.db, db-config.json, and uploaded icons), and starts it back up:
cd ~/uptime-kuma
mkdir -p ~/backups/uptime-kuma
docker compose stop uptime-kuma
docker run --rm \
-v uptime-kuma_uptime_kuma_data:/data:ro \
-v "$HOME/backups/uptime-kuma:/backup" \
busybox:1.37.0 \
tar czf "/backup/uptime-kuma-$(date +%F).tar.gz" -C /data .
docker compose start uptime-kumaCopy the .tar.gz archive along with .env, Caddyfile, and docker-compose.yml off the VPS.
Restore onto a fresh volume (without Docker Compose warnings)
When restoring on a new server (or testing a wipe-and-restore), let Docker Compose create the volume first via docker compose create uptime-kuma. That preserves Compose's ownership labels so future docker compose up -d runs show zero external-volume warnings:
cd ~/uptime-kuma
docker compose down
docker volume rm uptime-kuma_uptime_kuma_data
docker compose create uptime-kuma
docker run --rm \
-v uptime-kuma_uptime_kuma_data:/data \
-v "$HOME/backups/uptime-kuma:/backup:ro" \
busybox:1.37.0 \
sh -c 'rm -rf /data/* /data/.[!.]* && tar xzf /backup/uptime-kuma-2026-12-04.tar.gz -C /data'
docker compose up -dIn our clean VM test, Uptime Kuma came back online in 2 seconds after the restore with the admin login, all three monitors, and the Webhook channel intact and zero Compose warnings.
8. Controlled upgrades
Before upgrading, read the Uptime Kuma release notes and run the backup above. Then update the pinned tag in docker-compose.yml (the example moves from 2.5.12 to 2.5.13; substitute your current and target tags):
cd ~/uptime-kuma
sed -i 's|louislam/uptime-kuma:2.5.12|louislam/uptime-kuma:2.5.13|' docker-compose.yml
docker compose config -q
docker compose pull uptime-kuma
docker compose up -d
docker compose logs --tail=30 uptime-kumaTesting the upgrade from 2.5.12 to 2.5.13 recreated only the uptime-kuma container while Caddy kept running, returning to (healthy) in 7 seconds with every monitor and alert preserved.
Common issues
502 Bad Gatewayor Caddy failing to issue a certificate: verify yourADNS record resolves to the VPS IPv4, port80is reachable, andCaddyfilepoints touptime-kuma:3001on the sharedproxynetwork. Walk through Fix Caddy 502 Bad Gateway and HTTPS errors with Docker.required variable UPTIME_DOMAIN is missing a value:.envis missing, empty, or in a different directory. Run Compose commands from~/uptime-kuma.- Dashboard stuck on "Connecting..." or reconnecting continuously: an upstream proxy (such as an orange-clouded CDN setting or a custom Nginx config) is blocking WebSockets on
/socket.io/. With the directCaddyfileabove, WebSocket upgrades work out of the box. - Push monitor returns
404: the token in the URL does not match the monitor, or the monitor was paused/deleted. SQLITE_BUSYordatabase is locked: almost always caused by placing/app/dataon NFS or running two containers against the same volume.- Port
3001reachable on the public IP despiteufw:ports: - "3001:3001"was left indocker-compose.yml. Removeports:fromuptime-kumaand rundocker compose up -d.
What was outside the test
Testing ran inside an isolated Ubuntu 24.04.5 LTS virtual machine with no public IP. Real DNS propagation, public Let's Encrypt certificate issuance, and external HTTP/3 UDP traffic were not exercised; Caddy used tls internal with its local CA and the same reverse_proxy uptime-kuma:3001 block. Alerts were verified against a local Webhook receiver rather than external Telegram, Discord, or SMTP providers, and the RAM figures come from that VM as an order-of-magnitude reference.
Next steps
- If you run several Docker stacks on the same VPS and want a lightweight web UI behind Caddy, read How to install Portainer with Docker and Caddy on a VPS.
- If you want a full Git-driven PaaS with one-click templates (including Uptime Kuma), see How to install Coolify on a VPS securely and Coolify VPS.
- To isolate monitoring on a second server or size a machine for your stacks, compare Docker VPS, Linux VPS, and all VPS plans.