Mark Ku's Blog
Open Source · GitHub

Uptime Kuma Cluster

Turn single-node Uptime Kuma into a highly available cluster — smart load balancing, automatic failover and health checks, started with a single Docker Compose command.

Free · Open Source (MIT)🐳 Self-hosted · One-command Docker Compose
Cluster architecture

Core Features

Built to stay highly available under large-scale monitoring

⚖️

Smart load balancing

A two-stage OpenResty + Lua router assigns each new monitor to the least-busy node based on its current monitor count and status.

🔁

Automatic failover

When a node goes down its monitors are redistributed to healthy nodes, then restored when it recovers — without interruption.

❤️

Health checks

Periodically checks each node's /api/v1/health endpoint; consecutive failures mark it down and trigger failover (30s by default).

🗄️

Shared database

MariaDB replaces local SQLite as shared state, supporting concurrent reads and writes across nodes.

Horizontal scaling

Add or remove Uptime Kuma nodes dynamically — scale out by adding machines as your monitoring grows.

🧩

Cluster management API

Adds the REST APIs the original lacks, to query status and trigger health checks or rebalancing programmatically.

📌

Fixed-node debugging

Pin traffic to a specific node with a cookie for debugging; the pin clears automatically when that node goes offline.

🐳

One-command Docker

docker-compose-cluster.yaml brings up OpenResty, multiple nodes and MariaDB in a single command.

Original vs Cluster

What this project adds on top of the original Uptime Kuma

FeatureOriginal Uptime KumaThis project (Cluster)
ArchitectureSingle nodeMulti-node HA cluster
DatabaseSQLite (local)MariaDB (shared)
Load balancingNoneOpenResty + Lua smart routing
Failure handlingService interruptionAutomatic monitor redistribution
Horizontal scalingNot supportedDynamic add/remove nodes
Health checksNonePeriodic endpoint checks
Cluster management APINoneA set of REST APIs

Cluster Management API

All prefixed with /lb for automated monitoring and management

GET
/lb/ping

Liveness check

GET
/lb/health

Cluster health status

GET
/lb/system-status

Full system status report

GET
/lb/available-nodes

List nodes with load metrics

GET
/lb/fixed-node/{node}

Pin traffic to a specific node

POST
/lb/trigger-health-check

Manually trigger a health scan

GET
/lb/trigger-rebalancing

Force monitor redistribution

GET
/lb/rebalancing-status

View rebalancing progress

Quick Start

  1. 1

    Clone https://github.com/markku636/uptime-kuma-cluster and enter the project directory.

  2. 2

    Run the Docker Compose command below to bring up OpenResty, three Uptime Kuma nodes and MariaDB at once.

  3. 3

    Verify with curl http://localhost:8084/lb/health and /lb/available-nodes that the cluster is healthy.

Requires Docker and Docker Compose; node count, health-check interval and more are configurable via environment variables.

Need a highly available platform that handles monitoring at scale?

Free, open source (MIT) and self-hostable. See the full docs, Docker Compose and source on GitHub.

Uptime Kuma Cluster — Highly Available Monitoring Cluster (Open Source) | Mark Ku's Tech Blog - Mark Ku's Tech Notes