---
title: "Deploy Uptime Kuma 2 Monitoring + Status Pages (MariaDB)"
description: "Self-hosted uptime monitoring, alerts and status pages on MariaDB."
category: "Observability"
url: https://railway.com/deploy/uptime-kuma-2-monitoring-status-pages-ma
---

# Deploy Uptime Kuma 2 Monitoring + Status Pages (MariaDB)

Self-hosted uptime monitoring, alerts and status pages on MariaDB.

**[Deploy Uptime Kuma 2 Monitoring + Status Pages (MariaDB) on Railway](https://railway.com/template/uptime-kuma-2-monitoring-status-pages-ma)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/uptime-kuma-2-monitoring-status-pages-ma/manifest.json

- **Creator:** Tracklayer
- **Category:** Observability
- **Total deploys:** 1

## Template content

### Uptime Kuma https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/uptime-kuma.svg

- **Source:** baranberkay96/uptime-kuma-railway
- **Health check:** /api/entry-page
- **Public domain:** Yes

### MariaDB https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mariadb.svg

- **Image:** mariadb:12.3.3@sha256:4aaf88b3106382c8c18e49f0cec60267be618fc22f858c4503afb2a2555afed3
- **Start command:** `/bin/bash -c 'set -e; F=/etc/mysql/conf.d/zz-railway.cnf; X=/tmp/zz-railway.cnf; k() { v=$1; if [ $v -lt $2 ]; then v=$2; fi; if [ $v -gt $3 ]; then v=$3; fi; echo $v; }; n() { case "$1" in ""|*[!0-9]*) echo $2 ;; *) echo $1 ;; esac; }; w() { echo "$1 = $2" >> $X; }; echo "# Railway template: rewritten at every boot from the DB_* variables; DB_EXTRA_ARGS overrides it" > $X; echo "[mariadbd]" >> $X; COL="${DB_COLLATION:-utf8mb4_unicode_ci}"; case "$COL" in utf8mb4_) COL=bad ;; utf8mb4_*[!a-z0-9_]*) COL=bad ;; utf8mb4_*) ;; *) COL=bad ;; esac; if [ "$COL" = bad ]; then echo "mariadb-tune: DB_COLLATION=${DB_COLLATION} is not a utf8mb4 collation name, using utf8mb4_unicode_ci"; COL=utf8mb4_unicode_ci; fi; w character_set_server utf8mb4; w collation_server $COL; if [ "$COL" != utf8mb4_uca1400_ai_ci ]; then w character_set_collations utf8mb4=$COL; fi; w max_allowed_packet 64M; w innodb_use_native_aio 0; w ignore_db_dirs lost+found; case "${DB_SLOW_QUERY_LOG:-off}" in on|ON|On|true|TRUE|True|yes|1) SLOW=on ;; *) SLOW=off ;; esac; if [ $SLOW = on ]; then LQT="${DB_LONG_QUERY_TIME:-2}"; case "$LQT" in ""|.|*[!0-9.]*|*.*.*) LQT=2 ;; esac; w log_output TABLE; w log_slow_query ON; w log_slow_query_time $LQT; fi; if [ "${DB_TUNING:-auto}" = off ]; then echo "mariadb-tune: DB_TUNING=off, MariaDB defaults apply to memory and connections"; else H=$(( $(n "$(grep -m 1 MemTotal /proc/meminfo | tr -s " " | cut -d " " -f 2)" 1048576) / 1024 )); L=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo max); M=$(( $(n "$L" $((H * 1048576))) / 1048576 )); if [ $M -gt $H ]; then M=$H; fi; B=$(k $(n "$DB_MEMORY_LIMIT_MB" $(k $M 256 8192)) 256 4194304); P=$(k $(n "$DB_BUFFER_POOL_MB" $(k $((B / 2)) 128 2097152)) 32 4194304); C=$(k $(n "$DB_MAX_CONNECTIONS" $(k $((B / 8)) 100 500)) 10 100000); T=$(k $((B / 64)) 16 64); w innodb_buffer_pool_size ${P}M; w innodb_log_file_size $(k $((P / 4)) 96 512)M; w max_connections $C; w tmp_table_size ${T}M; w max_heap_table_size ${T}M; w innodb_io_capacity 1000; w innodb_io_capacity_max 2000; echo "mariadb-tune: budget ${B}MB (container ${M}MB, host ${H}MB)"; fi; mkdir -p /etc/mysql/conf.d; install -m 644 $X $F; echo "mariadb-tune: $(grep -v "^#" $X | paste -sd " " -)"; set -f; exec docker-entrypoint.sh "$@" ${DB_EXTRA_ARGS:-}' mariadb-start mariadbd`

## Documentation

# Deploy and Host Uptime Kuma with Railway

Uptime Kuma is a self-hosted monitoring tool: it checks websites, APIs, ports, DNS, databases, Docker hosts and more every few seconds, alerts you through 90+ notification services, and publishes status pages. This template runs Uptime Kuma 2.12 on MariaDB 12.3 LTS, with the admin account created from a generated password.

> Community template, not affiliated with the Uptime Kuma project.

## About Hosting Uptime Kuma

Uptime Kuma is a Node.js app with a web dashboard. Version 2 can store its data in MariaDB instead of a single SQLite file, which keeps the dashboard fast when you have many monitors and a long history. This template runs Uptime Kuma and a MariaDB service on Railway's private network, with a volume for uploads and screenshots.

A fresh Uptime Kuma normally shows a "create your admin account" page to whoever opens it first, which on a public domain could be anyone. This template creates the admin account before the web server starts, from `UPTIME_KUMA_ADMIN_USERNAME` and the generated `UPTIME_KUMA_ADMIN_PASSWORD`, so that page is never exposed.

## Common Use Cases

- Monitor your websites, APIs and SSL certificate expiry, with alerts to Slack, Discord, Telegram, email, Teams, PagerDuty or webhooks
- Publish a public status page for your product, with incidents and maintenance windows
- Check private services in your Railway project (databases, internal APIs) over the private network
- Receive push heartbeats from cron jobs and backups, and alert when one does not arrive

## Dependencies for Uptime Kuma Hosting

- Uptime Kuma service (repo build on the official `louislam/uptime-kuma:2.5.12` image, volume at `/app/data`)
- MariaDB 12.3 LTS (official image, volume)

### Deployment Dependencies

- [Uptime Kuma on GitHub](https://github.com/louislam/uptime-kuma) (MIT license)
- [Uptime Kuma wiki](https://github.com/louislam/uptime-kuma/wiki)
- [Environment variables](https://github.com/louislam/uptime-kuma/wiki/Environment-Variables)
- [MariaDB documentation](https://mariadb.com/docs)

### Implementation Details

| Service | Image | Purpose |
|---|---|---|
| Uptime Kuma | `louislam/uptime-kuma:2.5.12` + start script | Dashboard, monitors, status pages on port 3001 |
| MariaDB | `mariadb:12.3.3` | Monitors, heartbeats, settings (private network only) |

**First steps**

1. Open the Uptime Kuma service, Variables tab, and copy `UPTIME_KUMA_ADMIN_USERNAME` (default `admin`) and `UPTIME_KUMA_ADMIN_PASSWORD`.
2. Open `https://{your-domain}` and log in. Change the password in Settings, Security, and turn on two-factor authentication there.
3. Add a monitor, then a notification (Settings, Notifications), and optionally a status page.
4. To monitor services in this Railway project, use their private address, for example `http://myapp.railway.internal:8080/health`.

**Admin account**

- `UPTIME_KUMA_ADMIN_PASSWORD` is applied at the first start only; later changes in the web UI are kept.
- If the variable is empty, shorter than 12 characters, has spaces or is too weak, the account is created locked with a random password and the log says how to fix it. The next start with a valid password unlocks it.
- Lost the password? Set a new `UPTIME_KUMA_ADMIN_PASSWORD`, set `UPTIME_KUMA_ADMIN_RESET_PASSWORD=true`, redeploy, log in, then set the flag back to `false`. This also signs out all sessions.

**Database**

`UPTIME_KUMA_DB_TYPE=mariadb` (default) uses the MariaDB service; the connection variables reference it, so passwords stay in sync. `sqlite` keeps everything in a file on the Uptime Kuma volume instead (you can then delete the MariaDB service). Choose before the first start: Uptime Kuma does not migrate between the two. MariaDB is tuned for about 512 MB (`DB_MEMORY_LIMIT_MB`); raise it for thousands of monitors.

**Resources and plans**

Measured on Railway: Uptime Kuma about 0.15 GB with a few monitors, MariaDB about 0.16 GB. Each monitor adds a little memory and CPU; "Real Browser" monitors start Chromium and need several hundred MB more. Both services fit the Trial plan (1 GB per service).

**Scaling and upgrades**

Run a single replica: Uptime Kuma schedules all checks in one process. To upgrade, change `KUMA_IMAGE` (tag and digest) in `services/uptime-kuma/Dockerfile` of your fork; migrations run automatically at start. Back up first with Railway's volume backups on both services. Version 3 is in beta; stay on 2.x until it is released.

### Why Deploy Uptime Kuma on Railway?

Railway runs Uptime Kuma and its database as one project with HTTPS, private networking and volume backups, so you have a monitoring dashboard and status page in minutes without managing a server, and you can monitor your other Railway services over the private network.


## Similar templates

- [Rootprint](https://railway.com/deploy/rootprint-1) — Open-source logs and traces with full-text search on object-storage.
- [Pyroscope profiling](https://railway.com/deploy/pyroscope-profiling) — Protected continuous profiling with durable Pyroscope storage.
- [SigOnly](https://railway.com/deploy/sigonly) — Deploy SigNoz with a working demo app & config in one click

Open this page in a browser: https://railway.com/deploy/uptime-kuma-2-monitoring-status-pages-ma
