Approved, not published yet. Visible on the preview site only.

Free uptime monitoring for a small business server, with alerts on your phone

How to monitor a small business server for free with Uptime Kuma and ntfy: service checks, backup heartbeats and phone alerts before your clients notice.

Software8 min read

Network cables plugged into the ports of a small server, lit by amber status lights

The worst way to learn your email is down is from a client. The second worst is from a client who has stopped emailing.

A small server running email and files will fail now and then: a disk fills, a certificate expires, a backup stops. What matters is whether you hear in two minutes or two weeks.

We watch our own server with two free, self-hosted tools: Uptime Kuma runs the checks, ntfy puts alerts on a phone.

Why bother, and when not to

A small business has no operations team, only whoever set the server up. Monitoring checks every minute and speaks up only when something is wrong.

  • You find out first, and can fix it or warn people before anyone notices.
  • Quiet failures become loud. Backups, scheduled jobs and certificate renewals fail without crashing anything.

When not to bother: if everything you run is a hosted service (Google Workspace, Microsoft 365, a website builder), the provider already monitors it. And if nobody will act on an alert, skip it.

What you need

  • A server already running your services, ideally with Docker.
  • Uptime Kuma and ntfy: both free and open source.
  • A reverse proxy with HTTPS in front of both (Caddy, nginx or similar).
  • A phone with the ntfy app, free on Android and iOS.
  • Optional: an external uptime checker for when the whole server is off.
Diagram showing Uptime Kuma checking services and receiving pushes from host scripts, then sending alerts through ntfy to a phone
Diagram showing Uptime Kuma checking services and receiving pushes from host scripts, then sending alerts through ntfy to a phone

How to set it up

  1. Run both apps. A minimal compose file, on the same Docker network as your proxy:

    services:
      uptime-kuma:
        image: louislam/uptime-kuma:2.5.9
        restart: unless-stopped
        volumes: [./uptime-kuma:/app/data]
        networks: [proxy]
      ntfy:
        image: binwiederhier/ntfy:v2.37.2
        restart: unless-stopped
        command: serve
        volumes: [./ntfy/cache:/var/cache/ntfy, ./ntfy/etc:/etc/ntfy]
        networks: [proxy]
    networks:
      proxy:
        external: true
    

    Pin both images to a release like this, update one at a time, and read the release notes first. For Kuma use a 2.x tag: latest still points at 1.23, so a box on latest with an auto-updater never reaches 2.x, and the Alpine variants stop at 1.x. Then add two sites to your Caddyfile:

    kuma.example.com { reverse_proxy uptime-kuma:3001 }
    ntfy.example.com { reverse_proxy ntfy:80 }
    

    Kuma uses WebSockets: Caddy handles them; nginx needs the Upgrade and Connection headers or the dashboard loads blank.

    ntfy must be reachable from mobile data, not just your office Wi-Fi. On an office or home line that means dynamic DNS plus a port forward, or a tunnel.

    When it works, the Kuma address opens a setup page that asks which database to use. SQLite is the default and fine at this size; the image also has an embedded MariaDB. The choice is saved in data/db-config.json. Then create the admin account straight away.

    To upgrade from 1.x, copy the data folder first, because 2.x dropped the JSON backup and restore from Settings. Bump the tag on the standard image, not a rootless one, and let the one-time heartbeat migration finish on first start without interrupting it. Ours took about 14 minutes for 58 monitors and 1.6 million heartbeats.

    The simplest protection is to keep Kuma off the public proxy and reach it over Tailscale or your VPN. If it must be public, add an IP allowlist or basic auth on the proxy site, and turn on two-factor in Kuma under Settings, Security.

  2. Add a monitor per service, using the most specific type.

    • HTTP(s) Keyword loads a page and checks a word appears. For example: URL your Nextcloud login page, Keyword Log in, Heartbeat Interval 60 seconds, Retries 2, Retry Interval 30. The keyword is case sensitive; pick text only a working page shows, not the site name in the title.
    • TCP port for things with no web page. For mail, add one monitor for IMAP and one for SMTP submission, using the container name as host. A TCP check only proves the port answers, so pair it with a push heartbeat on the nightly mail backup.
    • Certificate expiry is not a monitor type: on each HTTPS monitor tick Certificate Expiry Notification; the warning days live under Settings, Notifications, TLS Certificate Expiry. If your proxy renews certificates automatically, this is your canary for renewal breaking.
    • JSON query reads one value from an API's JSON reply and compares it with an operator (equals, not equals, greater than and so on), so a health endpoint or a queue length can be checked properly.
    • Docker container needs the Docker socket, which is effectively full control of the machine.
    • Push waits for something to call Kuma. Create the monitor, copy the push URL Kuma shows (it ends in a token), set Heartbeat Interval a little over the job's period (26 hours for a nightly backup), and end the job with curl -fsS "[push url]?status=up&msg=done" >/dev/null. The monitor stays grey until the first call, then turns green.
  3. Group monitors and set retries. Group by area (mail, files, websites, infrastructure) so a red group tells you where to look. Then set 2 retries, 30 seconds apart on everything; new monitors in 2.x start at 0. When it works, a container restarting in 20 seconds no longer pages anyone, but something down for over a minute still does.

  4. Connect ntfy. In Kuma, add a notification of type ntfy with your server address and a topic, and tick "default enabled". Use separate topics for separate sources, for example one for uptime, one for backups and one for updates, so you can mute the chatty ones. Any script can post with one request:

    curl -d "Nightly backup finished" https://ntfy.example.com/backups
    
  5. Lock ntfy down. By default anyone who knows a topic name can read it, and alerts can contain service names and error text. Set anonymous access to write-only:

    # server.yml
    base-url: "https://ntfy.example.com"
    behind-proxy: true
    upstream-base-url: "https://ntfy.sh"
    auth-file: "/var/cache/ntfy/user.db"
    auth-default-access: "write-only"
    

    Without auth-file set, adding a user fails, and if the file is not on a volume your users vanish when the container is recreated. Edit ./ntfy/etc/server.yml, run docker compose restart ntfy, then docker compose exec ntfy ntfy user add --role=admin yourname (it asks for a password). In the phone app, Settings, Manage users: add your server address with that login, then subscribe to your topics and press Kuma's test button. When it works, the phone buzzes within a second or two, and opening a topic in a browser without logging in is refused.

    Write-only means existing publishers keep working. It still lets anyone who guesses a topic name push a fake alert to your phone. Either use long random topic names (backups-7f3k9q, not backups), or set auth-default-access: "deny-all" and create one access token for Kuma and one for the host script.

  6. Add host checks on a systemd timer. Some things are invisible from inside a container: disk space, disk health, whether SSH or the file share is running, whether the backup produced anything. A small script runs every minute and calls a push monitor for each check. Adapt it; it is not a drop-in tool. Push tokens live in a root-only file, never in the script.

    #!/bin/bash
    set -u
    . /etc/host-push.env   # PUSH_SSH=..., PUSH_DISK=..., PUSH_BACKUP=... (chmod 600)
    KUMA="https://kuma.example.com"
    
    push() { local tok="PUSH_$1" s=up; [ "$2" = ok ] || s=down
      curl -fsS -m 10 -G "$KUMA/api/push/${!tok}" \
        --data-urlencode "status=$s" --data-urlencode "msg=$3" -o /dev/null || true; }
    check() { local key=$1 label=$2 out; shift 2
      if out=$("$@" 2>&1); then push "$key" ok "$label OK"
      else push "$key" fail "${out:-$label failed}"; fi; }
    
    disk_ok()   { local p; p=$(df --output=pcent / | tail -1 | tr -dc 0-9)
                  [ "$p" -lt 85 ] || { echo "root disk ${p}% full"; return 1; }; }
    backup_ok() { [ -n "$(find /backups -name '*.sql.gz' -mmin -1560 -size +10k | head -1)" ] \
                  || { echo "no backup over 10 KB newer than 26 hours"; return 1; }; }
    
    check SSH    "sshd"   systemctl is-active -q ssh
    check DISK   "disk"   disk_ok
    check BACKUP "backup" backup_ok
    

    Save it as /usr/local/bin/host-push.sh, then add a service and a timer:

    # /etc/systemd/system/host-push.service
    [Service]
    Type=oneshot
    ExecStart=/usr/local/bin/host-push.sh
    
    # /etc/systemd/system/host-push.timer
    [Timer]
    OnBootSec=2min
    OnUnitActiveSec=1min
    
    [Install]
    WantedBy=timers.target
    

    Run sudo chmod +x /usr/local/bin/host-push.sh, sudo systemctl daemon-reload and sudo systemctl enable --now host-push.timer, then check it with systemctl list-timers. Give each push monitor a Heartbeat Interval of 120 seconds with 2 retries 30 seconds apart, so one late run does not raise an alarm. When it works, the failure text itself arrives on your phone: "root disk 91% full", not a bare "DOWN". If the script stops running altogether, the push monitors time out and go red anyway.

A monitoring dashboard with services grouped by area, each showing a row of green status bars
A monitoring dashboard with services grouped by area, each showing a row of green status bars

Check the output, not the exit code

The backup check above looks for a recent file of a sensible size, not for the script saying it finished. A backup step can copy from a folder that no longer exists for months while the completion alert still arrives every night. Check the output, not the exit code: alert when the newest dump is old or too small.

The same goes for any scheduled job: check what it produces.

What goes wrong

  • Alerts flapping red and green. Usually a reboot or a service restarting in under a minute, with zero retries set. Fix: retries, as in step 3.
  • A check fails that obviously should pass. Kuma inside Docker often cannot reach services listening only on the host's loopback address. Fix: check the container by name on the shared Docker network, the proxy network from step 1.
  • iPhone alerts late or missing. Apple delivers instant notifications only through its own push service. Fix: the upstream-base-url line in step 5, which relays a wake-up via ntfy.sh while the message stays on yours.
  • Nothing alerts when the server is off. Fix: an external checker watching one public page.
  • A public status page that maps your network. Adding every monitor to Kuma's status page hands visitors a map of your internal services. Keep it private, or list only what customers already know about.
  • History graphs shifted by hours. Kuma keeps its own timezone, which may not match yours. Fix: Settings, General, set the server timezone to yours.
  • Alert fatigue. An alert you learn to ignore is worse than none. Alert on what people use directly, plus the quiet things: backups, certificates and disks. Mute nice-to-haves at night.
A phone on a desk showing a push notification that a disk is nearly full
A phone on a desk showing a push notification that a disk is nearly full

Cost and time

  • Software: free. Uptime Kuma and ntfy are both open source.
  • Optional external checker: free tier, or a few hundred rupees a month (approximate).
  • Time: an evening for the apps, notifications and the first batch of monitors. Host checks take another evening.

The first time your phone warns of a full disk before anyone notices, the evenings have paid off.

TDH Systems can set up and look after a small business server, monitoring included. See what we build.

Written by Siddharth Agrawal, Founder and Director, TDH Systems.

Tell us what you have in mind. We will come back with a plan and a quote.

Start a project

Prefer email? Write to info@thydarkhour.com.