docs Deployment
self-hosting
Deployment
Running on Kubernetes instead? See Kubernetes for the Helm charts.
Production deployment with Caddy
For real-world operation, use the production stack under deployment/ in the repo. It puts a Caddy reverse proxy in front of the Rust service with:
- Automatic TLS via Let's Encrypt (HTTP/2 and HTTP/3 on by default)
- The app's own sign-in guarding the UI and API; the edge adds no second credential
- Postgres and ClickHouse on the internal docker network — no published ports
- ClickHouse memory-capped at ~2 GB (see
deployment/clickhouse-config.xml) - Caddy memory-capped at 1 GiB with no swap; past the cap it is restarted (exit 137)
Setup:
deployment/README.md is the authoritative source for setup, signing in, backups, and troubleshooting.
Authentication boundary
The Rust service ships an in-binary auth stack (GitHub, Google, Microsoft and GitLab OAuth, opaque API tokens, and magic-link sign-in, all enabled by default and each individually configurable). The native auth is the boundary; a basic-auth layer in front of Caddy would double-prompt. Single-tenant deploys behave the same way. Note that OAuth sign-up provisions an org for any identity that completes the flow, so an internet-facing instance that should not accept strangers needs a network or edge restriction of its own.
/healthz and /readyz are intentionally exposed without auth so
uptime probes, load balancers, and orchestrators can hit them.
/metrics on the public domain returns 404 — scrape it on the internal
docker network instead.
The public status page (/status, /status/*, /api/public/*,
/static/*, /robots.txt, /favicon.ico) is also unauthenticated by
design — see Public status surface below.
See Authentication for the in-binary flow.
Email provider (Resend)
Every mail the product sends (sign-in links, invitations, outage alerts, status-page subscriber updates, billing notices) goes through the EmailSender trait. Production uses Resend; dev and test default to the log provider, which writes the action URL to the tracing log so you can copy-paste it into a browser.
Setup:
-
Create a Resend account and verify your sending domain. Resend will give you DKIM and DMARC records to add to DNS.
-
Generate an API key with
emails.sendpermission only. -
Configure the service:
[] = "resend" = "Acme Status" = "status@acme.test" [] = "re_…"Or via env:
UPTIMEPAGE_EMAIL__PROVIDER=resend,UPTIMEPAGE_EMAIL__FROM_ADDRESS=status@acme.test,UPTIMEPAGE_EMAIL__RESEND__API_KEY=re_…. The address is required; the process refuses to boot without one.Send from an address somebody reads. Every reply comes back to it, including auto-responders to outage alerts and subscriber updates. A
no-reply@sender leaves a confused recipient with no way to answer except the spam button, and mailbox providers count replies in the sender's favour. -
auth.public_base_urlmust be set to the externally-reachable origin (e.g.https://status.acme.test); the value is embedded in the links the recipient receives.
Boot refuses provider = "resend" without both the API key and the from address, and warns when the from address is a no-reply@ one: fail-fast over send-time surprise.
Resend limits requests per second for the whole team, across every API key, so every instance books its sends in one Postgres row and together they stay under email.resend.rate_limit_per_second (10 unless Resend raised yours). Sign-in links, alerts, billing notices and other mail someone is waiting for go ahead of status-page subscriber updates, which travel 100 to a request, and owner reminders. When Resend still answers 429, every instance waits the time it names. An instance that cannot reach Postgres keeps sending sign-in links and alerts at a fifth of the limit and holds subscriber updates until it can.
Email provider (SMTP)
To send through your own mail server (Postfix, Mailcow, Exchange, a relay in a home lab) instead of an HTTP API, use the smtp provider. Every mail goes through it, the same as above.
[]
= "smtp"
= "Acme Status"
= "status@acme.test"
[]
= "mail.acme.test"
= "starttls" # or "tls" for port 465, "none" for a relay without TLS
= "status@acme.test"
With the bundled docker-compose.yml, set UPTIMEPAGE_EMAIL_PROVIDER=smtp and the UPTIMEPAGE_EMAIL_SMTP_* variables (HOST, PORT, SECURITY, USERNAME, PASSWORD, CA_FILE, ACCEPT_INVALID_CERTS) in .env, mounting a CA file into the container yourself; on Kubernetes, the chart's email.smtp values. Directly via env: UPTIMEPAGE_EMAIL__PROVIDER=smtp, UPTIMEPAGE_EMAIL__FROM_ADDRESS=status@acme.test, UPTIMEPAGE_EMAIL__SMTP__HOST=mail.acme.test, UPTIMEPAGE_EMAIL__SMTP__USERNAME=status@acme.test, UPTIMEPAGE_EMAIL__SMTP__PASSWORD=….
Most transactional mail services offer an SMTP relay next to their HTTP API, so the same settings work with them. All of these take security = "starttls" on port 587, the default:
| Service | host | username | password |
|---|---|---|---|
| SendGrid | smtp.sendgrid.net | apikey, literally | an API key with Mail Send permission |
| Mailgun | smtp.mailgun.org, or smtp.eu.mailgun.org for an EU domain | the domain's SMTP login, such as postmaster@mg.acme.test | that login's SMTP password |
| Postmark | smtp.postmarkapp.com | the Server API token, or an SMTP token's access key | the same Server API token, or the SMTP token's secret key |
| Amazon SES | email-smtp.<region>.amazonaws.com | the SES SMTP user name | the SES SMTP password, generated in the SES console; not your AWS secret access key |
| Brevo | smtp-relay.brevo.com | your SMTP login | an SMTP key |
| Gmail, Google Workspace | smtp.gmail.com | the full address | an app password |
Verify your sending domain with the service first (its SPF and DKIM records): an unverified sender is refused, and the mail waits instead of going out. Prefer port 587 over 25 and 465: many cloud hosts block outbound 25, and Hetzner Cloud blocks 465 as well.
security = "starttls"(port 587) connects in plain text and refuses to go on unless the server upgrades to TLS."tls"(port 465) speaks TLS from the first byte."none"never encrypts: fine for a relay on the same host or a network you trust, and boot warns when a password would cross it.- Leave
usernameandpasswordboth empty for a relay that takes mail without a login. - The server's certificate is checked against the system's trusted roots. For a server signed by a private CA, as in many company networks and home labs, point
ca_fileat that CA's PEM certificate: it is trusted on top of the system roots, and withstarttlsortlsa missing or empty file stops the boot.accept_invalid_certs = trueskips the check altogether, for a self-signed test server; anyone on the path can then read the mail and the password, and boot warns about it. - The host may be a private or loopback address; it is your configuration, not user input.
- The client greets the server (EHLO) with the machine's host name, or with the sender's domain when the host name is not a full domain, as inside a container.
Boot refuses provider = "smtp" without a host and a from address, or with only one of username and password.
How a refusal is handled depends on what the server refused:
- The login, the connection or the sender address: every mail would meet the same answer, so status page subscriber updates wait and go out once the configuration is fixed. A server-wide 4xx "try later" waits 30 seconds.
- One recipient: a mail is given up only when the server's enhanced status code puts the fault on the address or the message, such as
5.1.1no such user,5.2.2mailbox full or5.3.4too big. Any other refusal, including a policy one such as relaying denied or one with no enhanced code at all, may be about your setup, so that mail waits instead. A 4xx such as greylisting tries that mail again later, and a recipient that stalls or drops the connection costs the rest of the batch one 30 second wait, not its delivery. - A message timed out after it was sent, while the server scanned it, may arrive twice when it is tried again: SMTP has no way to ask whether it was taken.
Switching provider while status page subscriber mail is still being retried can send that batch again through the new one.
Bounces that arrive later, after your server accepted a mail, go to the from_address mailbox; they are not read back, so an email alert channel pointed at a dead address stays on.
Public status surface
The Caddyfile carries an @public matcher that handles the public status paths ahead of the catch-all and adds a per-IP rate limit (60 req/min) via the caddy-ratelimit plugin. The stock caddy:2-alpine image doesn't include that plugin, so the production deployment uses a custom custom-caddy:2 image built with xcaddy:
Then point the caddy service in deployment/docker-compose.yml at custom-caddy:2. Full procedure (including the opt-out path that drops the rate-limit block) is in deployment/README.md.
The same custom image carries the other per-IP zones, among them auth_endpoints (10/min on /auth/*, /api/v1/me, invitation accept), oauth_register (30/min on POST /oauth/register, the open MCP client registration) and org_creation (3 per 24 h on POST /api/v1/orgs); the full list is in deployment/README.md. These are the edge tier; the per-org / per-user budgets the service enforces from each org's plan are the Quotas & rate limits tier — complementary, since behind the proxy the app sees only the proxy as the peer.
Per-org subdomains (SaaS)
When tenancy.subdomain_public_routes = true, each org's page is served at {slug}.{public_status.base_domain} (apex-wildcard shape). That needs:
- a wildcard DNS record
*.{domain}pointing at the host (plus explicit A/AAAA records for any operator subdomain —app,mail, etc. — which take precedence over the wildcard); - a wildcard TLS cert for
*.{domain}. HTTP-01 can't validate a wildcard, so the custom Caddy image also bundlescaddy-dns/hetznerand solves the ACME DNS-01 challenge using aHETZNER_DNS_API_TOKEN(zone-edit scope) from.env. The operator host (app.{domain}) and the MCP host (mcp.{domain}) are kept on their own per-host HTTP-01 certs in separate Caddyfile blocks so a wildcard-key compromise reaches neither the operator surface nor connector bearer tokens. The app serves only/mcpand/.well-known/*on the MCP host; every other route answers 404 there, the same default-deny the tenant hosts get.
The wildcard means a new org's page works the moment its owner enables it — no per-org DNS or cert step. The end-to-end runbook (Hetzner zone setup, token scope, building the image, verifying the wildcard cert) is in deployment/README.md. The model — host routing, branding, opt-in gating, cookie scoping — is in Per-org status pages.
For the operator workflow (enabling components, narrating incidents, scheduling maintenance) see Public status page.
Docker
docker compose up -d brings up Postgres 18, ClickHouse 26.10, and the monitor on the same network. It pulls the published image ghcr.io/uptimepage/uptimepage:latest; override the tag with UPTIMEPAGE_IMAGE, or build from a checkout with docker compose -f docker-compose.yml -f compose.build.yml up -d --build. Compose env vars wire the monitor to the stack:
UPTIMEPAGE_STORAGE__POSTGRES__URL: postgres://monitor:monitor@postgres:5432/monitor
UPTIMEPAGE_STORAGE__CLICKHOUSE__URL: http://clickhouse:8123
UPTIMEPAGE_STORAGE__CLICKHOUSE__USER: monitor
UPTIMEPAGE_STORAGE__CLICKHOUSE__PASSWORD: monitor
UPTIMEPAGE_STORAGE__ALLOW_DEFAULT_CREDENTIALS: "true"
UPTIMEPAGE_OBSERVABILITY__LOG_FORMAT: json
The runtime image is gcr.io/distroless/static-debian12:nonroot for a minimal attack surface, no shell, and no glibc. Built from a static musl binary via rust:1-alpine. Final image is 16 MB — both uptimepage and loadtest binaries fit in the same image.
Bind addresses
Defaults are loopback (127.0.0.1:8080 API, 127.0.0.1:9090 metrics). Override via env for non-loopback exposure:
UPTIMEPAGE_SERVER__API_BIND=0.0.0.0:8080 \
UPTIMEPAGE_SERVER__METRICS_BIND=0.0.0.0:9090 \
The app authenticates its own routes, so this port is not open season, but it speaks plain HTTP and applies no per-IP limits. Terminate TLS in front of it or keep it on a private network. The ready-made Caddy stack under deployment/ does both.
Metrics shipping (Grafana Cloud)
The Prometheus /metrics endpoint can be shipped to Grafana Cloud by a
Grafana Alloy sidecar. It is opt-in: the compose stack only starts it
under the metrics profile (docker compose --profile metrics up -d),
so the default deployment is unchanged. Credentials are read from .env
(gitignored) and never written into deployment/config.alloy.
deployment/README.md ("Metrics") is the authoritative setup, including
how to obtain the Grafana Cloud URL/token, the internal-network bind, the
ready-made dashboard, and how to verify ingestion.
Migrations
- Postgres:
migrations/postgres/*.sql, applied at startup viasqlx::migrate!(tracked in_sqlx_migrations) - ClickHouse:
migrations/clickhouse/*.sql, applied idempotently viaCREATE … IF NOT EXISTSat startup
No external migrator. The app owns its schema lifecycle symmetrically.
Resource sizing
checker.max_concurrent_checkscaps simultaneous in-flight checks- Per-check memory: small (a tokio task + an in-flight hyper request + bookkeeping)
- The practical ceiling is set by file descriptors and ephemeral ports, not RAM
- At 50k concurrent checks against external targets, RSS sits around 200-400 MB depending on response sizes
- The optional
metricsprofile adds a Grafana Alloy container (~100 MB RSS plus a small bounded remote-write WAL volume) — account for it when sizing the host if you enable it - Each instance opens up to
storage.postgres.max_connections(16 by default) plus 2 for the email send gate. Set the Postgres server'smax_connectionsto cover every instance that can run at once, plus a few for backups and an adminpsql. A blue/green deploy runs two instances for its length, so the shippeddeployment/postgresql.confsets 50. When the server is short, connections opened during the overlap fail withsorry, too many clients already, and a new instance that cannot connect never turns ready. - Postgres reads
max_connectionsonly at startup: after changing it, recreate the container (docker compose up -d --force-recreate postgres). A restart can keep reading the old file, because a single-file bind mount pins the inode it started with.
Graceful shutdown
The binary listens for SIGINT and SIGTERM, cancels the scheduler and batcher via a shared CancellationToken, awaits both background tasks, and exits within 10 s. The batcher's cancel branch drains any pending results before returning. A warning is logged if the deadline is exceeded.