uptime-kuma¶
Uptime Kuma, the self-hosted monitoring tool, as its project publishes it, for a dotdash server's site. Visitors and probes that open the domain find its status page, the same page as on the tens of thousands of other Uptime Kuma installs on the internet, rather than an app only dotdash sites run.
Nothing of this repository is in it: the image is upstream's, unmodified
(version 2, the slim-rootless variant, without Chromium or the embedded
MariaDB, running as its own user), pinned by tag and digest in
bundle/manifest.yaml, with upstream's look, and the
page's language follows the visitor's browser, as on any install. Renovate
proposes each new upstream release. The bundle sets the image up before
anyone can reach it, from its parameters, and joins the site's network.
It uses about 130 MiB of memory idle and 156 MiB at most while it starts on a rig (limit 256 MiB), keeps a SQLite database in its volume, and runs on amd64 and arm64. The image is 548 MB unpacked.
Setup is never public¶
A fresh Uptime Kuma hands itself to its first visitor: its first-run page
makes whoever gets there first the admin. Here no visitor ever sees it. The
container runs bundle/setup/setup.js before the
server: it starts a copy of the server that listens on the container's
loopback alone, which nothing outside the container reaches, and drives it
over its own socket API, as its dashboard would. It makes the account admin
with the admin_password secret, turns the update check off, adds the
monitors and the status page, and stops the copy. Only then does the server
the site reaches start, on a database that has its admin already.
On a rig, polled from the site's network from before the container started: nothing answered for the first 15 seconds, and from the first answer on, every time, the server said no setup was needed, sent no visitor to the setup page, and refused a setup attempt.
The same step runs at every start, so the page follows the parameters, and a
changed admin_password becomes the account's password (by upstream's
reset-password tool). Don't turn on two-factor sign-in in the dashboard:
the step can't sign in then, and leaves the monitors and the page as they are.
What a stranger can reach¶
- The status page, at
/for the domain, and at/status/<slug>: the titlename, the monitors, their last beats and uptime, upstream's "Powered by Uptime Kuma" footer./for any other name, such as the machine's address, redirects to/status/<slug>. - What the page itself reads:
/api/status-page/<slug>and its heartbeat, incident history, badge and manifest, and the RSS feed at/status/<slug>/rss. - The dashboard asks for the password.
/dashboardand every other path serve the app's shell, which asks the server over its socket; the socket refuses everything but sign-in until someone signs in. Upstream allows 20 sign-in attempts a minute, for everyone together, then refuses the rest of the minute. - No setup, no signups: Uptime Kuma has one account, made above.
/metricsasks for that account's name and password (basic auth, under the same limit). The version isn't shown until sign-in.
Never list your other servers, relays or CDN names in monitors. The page
is public: whoever probes this server would read the rest of your network off
it. List things a small operator plausibly runs, such as mail, a git host, a
docs site or an API, or services of your own that have nothing to do with
dotdash. The checks leave from the machine's own address.
What it calls out to¶
Nothing but the monitors' own checks, as set here: on a rig, from its first start and for an hour after, its only packets off the container went to the monitored host and back to the site's network.
- Update check, to
uptime.kuma.petevery 48 hours: off (checkUpdate). On a fresh volume the copy that sets it up runs with every outbound call sent to a closed local port, so not even its first check, which runs before the setting can be made, leaves. - Notifications, Cloudflare tunnel, remote browsers, status page analytics: none set.
- The page's
index.htmlloads its own files alone.
What still calls out: each monitor, every minute, to its target, from the machine's address.
Pair it with a server¶
The server's site, a Caddy on the Docker network dotdash_edge, is what a
browser or a probe gets at the server's domain. uptime-kuma joins that
network as uptime-kuma, so the server's cover parameter points at
http://uptime-kuma:3001. Caddy then passes the app every request except
subscriptions, XHTTP and your own files in /srv/dotdash, which take
precedence over the app: keep that directory empty, or a stranger finds files
no Uptime Kuma has.
domain is the domain the server's site serves: the status page answers /
for it. Uptime Kuma trusts the X-Forwarded-* headers the site in front
sends, so its log names each visitor; only the containers on the site's
network reach it.
It also runs on a relay, dotdash relay 0.29 or later (0.28 needed the
own-site profile): there, set network=dotdash-relay_edge and use
--product dotdash-relay for the relay's cover.
Install¶
The server goes first, because it creates the network the app joins.
sudo morzer init --release oci://ghcr.io/morzecrew/dotdash-utils/uptime-kuma:stable \
--set name="Northwind Status" --set domain=status.example.net
sudo morzer --product uptime-kuma secret set admin_password # the dashboard's password
sudo morzer --product uptime-kuma config edit monitors # optional, see below
sudo morzer --product uptime-kuma apply
sudo morzer --product uptime-kuma status # wait for healthy
sudo morzer --product dotdash config set cover=http://uptime-kuma:3001
init prints the release's signing key and trusts it from then on. To check
even this first release, add --signing-key with the release key
this repository publishes.
morzer undoes the last config set if the site cannot reach the app, so run
it only once status shows the app healthy. With two installations on the
machine, every morzer command names the one it means with --product;
sudo morzer shell uptime-kuma opens a shell where commands mean this one.
Sign in at https://<domain>/dashboard as admin. Anything you change there
stays, except that the next start makes the monitors and the oldest status
page match the parameters again, turns the update check off, and turns the
dashboard's sign-in back on if it was turned off.
Parameters¶
| Parameter | Default | What it does |
|---|---|---|
name |
required | The status page's title. Its address, /status/<slug>, is made from it: northwind-status for Northwind Status. |
domain |
required | The domain the site in front serves, such as status.example.net. The status page answers / for it. |
monitors |
none |
The monitors, one per line (format below). none checks https://<domain>/ alone. |
network |
dotdash_edge |
The site's Docker network: dotdash_edge on a server, dotdash-relay_edge on a relay. It must exist before the app is applied. |
| Secret | What it is |
|---|---|
admin_password |
The password of the dashboard's account, admin. Anyone can try it, 20 times a minute: make it long and random, such as openssl rand -base64 24 gives. Uptime Kuma refuses a weak one, and the app then doesn't start. |
monitors takes one monitor a line, [Group /] Name | target. The target
is an https:// (or http://) URL, up while it answers below 500 (a 404 or
a login wall counts), or tcp://host:port, up while it takes a connection.
Each is checked every minute. Lines starting with # are skipped, and a line
without a group goes in Services:
Website | https://status.example.net/
Services / Mail | tcp://mail.example.net:25
Services / Git | https://git.example.net/
A monitor whose line stays the same keeps its history; one whose line changes starts afresh. A new install has no history, so its uptime fills in day by day.
Updating¶
Each upstream release reaches a server in three steps: Renovate's pull
request moves the pin (merge it once its smoke install passes), main
publishes the bundle on the dev channel, and a release tag puts it on
stable. Then, on each machine:
sudo morzer --product uptime-kuma update # the newest stable release
Uptime Kuma migrates its database forward as it starts, and an older release
won't start on a database a newer one migrated, so rollback refuses: the
way back is the backup morzer took before the update, which the refusal
names (morzer restore).
To remove it, point the site back at its own page first, then remove the
installation. installation list shows its id. The data volume stays unless
you add --purge:
sudo morzer --product dotdash config set cover=pages
sudo morzer --product uptime-kuma installation remove --force --confirm <its inst_… id>