Self-hosted monitoring with Uptime Kuma and ntfy


Monitoring setup

There's a lovely phase in every homelab when everything appears to be working. Until you realize Nextcloud hasn't been reachable since Tuesday. Or a container has quietly died while Proxmox itself carries on as if nothing happened.

By now I run too many services to rely on "it'll probably be fine": Proxmox, Home Assistant, Docker, Nextcloud, Pi-hole, VPN, and a few public services on my VPS.

I wanted two things: know when something breaks, and get the warning straight to my iPhone. Uptime Kuma and ntfy do the job. One Kuma instance runs on my external VPS, the other inside my home network — originally on an old Raspberry Pi 3B+. No monster monitoring stack, no extra database just to display a few red and green lights.

Why two Uptime Kuma instances?

I could monitor everything from the internet. But that only tells part of the story.

If my home internet connection fails, an external monitor can't tell whether Home Assistant is broken or the entire connection is down.

So I split the monitoring into two viewpoints. The VPS checks services that should be reachable from outside. The Raspberry Pi checks internal systems on the LAN.

There is one obvious limitation: if the Pi or the entire home network fails, the internal instance cannot send an alert either. That's precisely why these two locations complement each other.

Uptime Kuma on the VPS

Docker was already running on my VPS, so adding Uptime Kuma was straightforward. My Compose setup looks roughly like this:

services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    container_name: uptime-kuma
    restart: unless-stopped
    volumes:
      - ./kuma/storage:/app/data
    ports:
      - "127.0.0.1:3001:3001"

Kuma listens only on localhost. Caddy handles public HTTPS access:

status.example.com {
    reverse_proxy 127.0.0.1:3001
}

That way port 3001 isn't directly exposed to the internet.

Push notifications with ntfy

A dashboard is nice, but it doesn't help much if nobody is looking at it. When something fails, I want a notification on my phone.

I use ntfy, also running in Docker on the VPS:

ntfy:
  image: binwiederhier/ntfy:latest
  container_name: ntfy
  command:
    - serve
  environment:
    - TZ=Europe/Berlin
  volumes:
    - ./ntfy/config:/etc/ntfy
    - ./ntfy/storage:/var/lib/ntfy
  ports:
    - "127.0.0.1:8080:80"
  restart: unless-stopped

Caddy provides HTTPS for this service too:

ntfy.example.com {
    reverse_proxy 127.0.0.1:8080
}

Anonymous access is disabled. The configuration is roughly:

base-url: "https://ntfy.example.com"

cache-file: "/var/lib/ntfy/cache.db"
auth-file: "/var/lib/ntfy/user.db"

auth-default-access: "deny-all"
enable-login: true
behind-proxy: true

upstream-base-url: "https://ntfy.sh"

The last line matters for my iPhone. Through 'upstream-base-url', my server sends a small wake-up notification via ntfy.sh and Apple's push infrastructure. The actual message is then fetched from my own server. Without that step, iOS notifications may arrive much later.

The 'base-url' must match the server address entered in the iPhone app, and upstream rate limits are worth watching in production. In my tests, alerts normally arrived within a few seconds.

A dedicated ntfy account for Kuma

I created a separate technical account instead of reusing a personal login:

docker exec -it ntfy ntfy user add kuma
docker exec -it ntfy ntfy access kuma uptime rw

This user is restricted to the 'uptime' topic.

In Uptime Kuma, I configure ntfy as the notification provider:

Server:
https://ntfy.example.com

Topic:
uptime

Username:
kuma

Add the password, press Test, and that's it.

ntfy on the iPhone

I use the official ntfy iPhone app. I enter my server address:

https://ntfy.example.com

Then I sign in and subscribe to the relevant topic. The alerts appear like regular push notifications instead of disappearing into a pile of emails.

During my tests they generally arrived after about three to five seconds. More than fast enough for my homelab.

Giving an old Raspberry Pi 3B+ another job

I didn't want to run another VM just for internal monitoring. So an old Raspberry Pi 3B+ came out of the drawer.

It runs Raspberry Pi OS Lite and Docker. For basic checks I use the slim Uptime Kuma image:

services:
  uptime-kuma:
    image: louislam/uptime-kuma:2-slim
    container_name: uptime-kuma
    restart: unless-stopped
    ports:
      - "3001:3001"
    volumes:
      - ./storage:/app/data

For HTTP, TCP, and ping monitoring, that is enough. The Pi doesn't need to do anything more.

An old 8 GB SD card was enough for the initial setup. Would I trust an aging SD card for permanent monitoring? Not really. It would be rather embarrassing if the monitoring itself failed because of a dying card. Backups and a quick health check of the Pi are part of the plan.

Why ping alone isn't enough

A ping reply tells me that a machine answers ICMP. It does not prove that the service I care about is healthy.

A host can answer pings perfectly while its web application has been dead for hours.

For Proxmox, I therefore check the web interface:

https://192.168.1.x:8006

I may also monitor the host with ping. Combining the checks is more useful:

Ping: OK
Proxmox Webinterface: DOWN

The machine is probably running, but the web service has a problem.

If both fail:

Ping: DOWN
Proxmox Webinterface: DOWN

The host or the network path is more likely to be at fault. One extra check saves a surprising amount of guesswork.

HTTP is usually better than ping

Where possible, I use HTTP or HTTPS monitoring.

For Home Assistant:

http://192.168.1.x:8123

For Proxmox:

https://192.168.1.x:8006

The same principle works for a Synology web interface. If a service has no HTTP endpoint, I use a TCP monitor for the appropriate port. Ping remains an additional host-reachability check.

Monitoring Docker directly

Uptime Kuma can also watch Docker container status. Useful, certainly — but there is a security catch.

Plenty of tutorials simply mount the Docker socket:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock:ro

The ':ro' flag does not make this safe. It makes the filesystem mount read-only, not the Docker API. Access to the Docker socket can grant very extensive control over the host.

I wouldn't casually hand that access to an internet-facing monitoring container.

Some of my Docker services run on other machines anyway. Exposing an unauthenticated Docker API on TCP port 2375, even on an "internal" network, is not a good shortcut.

If I use remote Docker monitoring, the connection needs proper authentication and protection, such as TLS with client certificates or a tightly restricted socket proxy.

For many applications, I stick to checking the HTTP endpoint. That tells me whether the service is actually usable.

A running container is not necessarily a working application

Docker may happily report:

Container: running

while the application inside has stopped responding.

For important services I combine the container check with an HTTP check:

Docker container: UP
Webservice: DOWN

Now I know Docker still sees a running container, but the application needs attention.

What am I monitoring?

Gradually, I'm adding the systems that matter:

  • Proxmox hosts
  • Home Assistant
  • Synology
  • Pi-hole
  • Nextcloud
  • Docker containers
  • Internal web services
  • VPN connections
  • Public websites

Each gets a sensible check: HTTP for web apps, TCP for services without a web interface, and sometimes ping for the underlying host. Docker status can be an extra signal when it is worth the effort.

Who checks whom?

Two Kuma instances initially sound like duplicated work, but they make troubleshooting easier.

External Kuma

The VPS sees my setup from the internet and can answer questions such as:

  • Is the public website reachable?
  • Does an externally hosted service respond?
  • Can my home connection be reached at all?
  • Is the VPN endpoint available?

Internal Kuma

The Raspberry Pi sees the LAN:

  • Are the Proxmox hosts reachable?
  • Is Home Assistant responding?
  • Is the Synology available?
  • Are internal web services running?
  • Do the Docker applications answer?

If the external Kuma can't reach my home network but the internal checks are still green, the internet connection or the route outside is the likely suspect.

If several checks fail internally as well, I start looking at the local network or the hosts themselves.

One notification destination

Both Kuma instances can send notifications to the same ntfy server. That gives me one place on the phone for alerts.

Separate topics are possible:

uptime
server
home

For now, one shared monitoring topic is enough. I can split it up later if notifications get noisy.

Backing up Uptime Kuma

With Docker, Kuma's data lives in the mapped volume. The important part is knowing which directory the Compose project actually uses.

In my examples, the VPS uses './kuma/storage', while the Pi uses './storage'.

For the Pi installation, a simple consistent backup looks like this:

docker compose down
tar czf uptime-kuma-backup-$(date +%F).tar.gz storage
docker compose up -d

Stopping the container briefly avoids copying a database while it is being written to. For the VPS, I would back up 'kuma/storage' instead.

And yes, a backup only earns its name after a successful test restore. That's still on my maintenance checklist.

What I would do differently

I wouldn't create five monitors for every container. I mainly care about services I actually use, plus a few infrastructure checks underneath.

If a Proxmox host fails, twenty alerts about all its guests won't make the situation any clearer.

I would also test the notification path regularly. A nice green dashboard is comforting, but what matters is whether an outage really produces a message on my iPhone — including when one monitoring machine is down.

Was the tinkering worth it? Definitely. Not because I needed another dashboard, but because I learn about failures earlier and can narrow them down faster.

Two viewpoints, one place for push alerts, and mostly hardware I already had lying around. Even the old Raspberry Pi got a proper job again.


Technical references: Uptime Kuma Docker installation, ntfy server configuration, Securing access to the Docker daemon.

Previous Next