Cloud-hosted uptime monitors impose strict check intervals, lock alerting channels behind expensive monthly subscriptions, and expose internal service endpoints to third-party scrapers. By self-hosting Uptime Kuma in Docker, homelab administrators gain complete ownership of real-time server telemetry, sub-minute ping intervals, and native public status pages with zero recurring subscription fees.
Unlike resource-heavy enterprise stacks like Prometheus or Datadog, Uptime Kuma operates as a lightweight Node.js service backed by SQLite, consuming under 120 MB of RAM while monitoring hundreds of targets. This technical tutorial outlines the complete production deployment using Docker Compose, secure Docker daemon monitoring via a read-only socket proxy, SSL termination, and instant Telegram push alerts. For server security foundations, review our master guide on how to harden Ubuntu server security.
Key Takeaways
- Minimal Hardware Footprint: Runs comfortably on 1 vCPU and 120 MB of RAM, making it suitable for low-power Intel N100 mini PCs and small VPS nodes.
- Zero-Trust Socket Security: Never mount
/var/run/docker.sockdirectly with write permissions; use a read-only Docker socket proxy to isolate daemon controls. - Native WebSocket Support: Requires explicit
UpgradeandConnectionheaders in your reverse proxy configuration to prevent real-time heartbeat dashboard drops.
Self-Hosted Monitoring Matrix: Uptime Kuma vs Alternatives
Choosing the right homelab monitoring tool depends on whether you need external uptime checks, public incident communication, or deep system-level time-series metrics. While Uptime Kuma excels at endpoint availability and status pages, homelabs needing low-overhead CPU, GPU, and S.M.A.R.T. telemetry should pair it with our guide to self-host Beszel in Docker for complete multi-host visibility under 45 MB of RAM.
| Feature / Specification | Uptime Kuma | Gatus | UptimeRobot (Free) | Prometheus + Grafana |
|---|---|---|---|---|
| License & Source | MIT (100% Open Source) | Apache-2.0 (FOSS) | Proprietary SaaS | Apache-2.0 (FOSS) |
| RAM Consumption | ~110 MB – 140 MB | ~30 MB – 50 MB | 0 MB (Cloud Hosted) | 500 MB – 2 GB+ |
| Storage Backend | SQLite (kuma.db) | SQLite / PostgreSQL | Cloud Hosted | Prometheus TSDB |
| Native Status Pages | Yes (Multi-Page & Custom Slugs) | Yes (Automated) | Yes (Limited to 1) | Requires External Addon |
| Check Intervals | Down to 20 seconds | Custom Cron / Seconds | 5 minutes (300s limit) | Scrape interval based |
| Docker Socket Check | Yes (Container State) | No | No | Yes (via cAdvisor) |
| Alerting Channels | 90+ (Telegram, Signal, Discord) | 20+ (Webhooks, Slack) | Email / SMS (Paid) | Alertmanager matrix |
Step 1: Prepare Directory Structure & Persistent Storage
Creating a dedicated host directory structure ensures your monitoring configurations, SSL certificates, and historical SQLite metrics persist safely across container redeployments. Isolating application state under standard /opt paths adheres to Linux server deployment standards and streamlines automated backup scripts.
Connect to your server via SSH and execute the following commands to initialize the directory hierarchy and set ownership permissions:
sudo mkdir -p /opt/uptime-kuma/data
sudo chown -R 1000:1000 /opt/uptime-kuma/data
cd /opt/uptime-kuma
Setting ownership to UID 1000 matches the default unprivileged user within the official Uptime Kuma container image, preventing runtime write permission errors when the Node.js application generates its initial SQLite database files.
Step 2: Create the Production Docker Compose Configuration
A resilient Uptime Kuma deployment pins exact container versions, establishes local volume bindings, and avoids exposing raw administrative Docker sockets directly to the web service. Using Docker Compose allows you to declare resource limits and automatic restart policies in a single declarative file.
Create the Compose configuration file using your preferred terminal editor:
nano docker-compose.yml
Paste the following production configuration into the file:
services:
uptime-kuma:
image: louislam/uptime-kuma:2.5.9
container_name: uptime-kuma
restart: unless-stopped
ports:
- "127.0.0.1:3001:3001"
volumes:
- /opt/uptime-kuma/data:/app/data
security_opt:
- no-new-privileges:true
networks:
- monitoring-net
healthcheck:
test: ["CMD-SHELL", "extra/healthcheck"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
docker-proxy:
image: tecnativa/docker-socket-proxy:0.1.2
container_name: uptime-kuma-docker-proxy
restart: unless-stopped
environment:
- CONTAINERS=1
- POST=0
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- monitoring-net
networks:
monitoring-net:
driver: bridge
Notice that the web interface binds to 127.0.0.1:3001 rather than public 0.0.0.0:3001. This ensures unauthenticated traffic cannot bypass your reverse proxy firewall. The auxiliary docker-proxy container mounts /var/run/docker.sock in read-only mode (:ro) and sets POST=0, ensuring Uptime Kuma can inspect container health without possessing permissions to create, stop, or delete containers on your host.
Step 3: Launch the Stack & Complete Admin Onboarding
Once the Compose file is saved, bring up the monitoring services in detached mode and verify that both the application daemon and socket proxy pass their internal health checks. The initial bootstrap process creates the database schema and launches the local web server within five seconds.
Deploy the stack by executing the standard Compose startup command:
docker compose up -d
Inspect the running container state and live deployment logs using:
docker compose ps
docker compose logs -f uptime-kuma
Open your browser and navigate to http://YOUR_SERVER_IP:3001 (or via an encrypted tunnel). You are immediately prompted to create the primary administrator account. Enter a strong administrative password and save the credentials in your password manager. Once submitted, Uptime Kuma loads the central monitoring dashboard.
Step 4: Configure Heartbeat Monitors (HTTP, TCP, DNS & Docker)
Uptime Kuma supports multiple probing methods to verify service availability beyond basic ICMP ping packets. Configuring HTTP keyword checks, TLS certificate expiry warnings, and container state monitoring gives you comprehensive visibility across your homelab stack.
Click Add New Monitor in the top-left navigation panel and configure the probe parameters based on your target service:
- HTTP(s) Keyword Check: Set Monitor Type to
HTTP(s) - Keyword. Enter your application URL, set the Heartbeat Interval to60s, and define an expected response keyword (such asWelcomeorhealthy). This verifies that your web service is delivering real HTML content rather than an empty 200 OK error page. - TLS Certificate Expiry Warning: When monitoring HTTPS domains, check Certificate Expiry Notification and set the threshold to
14 days. Uptime Kuma automatically alerts you before Let’s Encrypt certificates lapse. - Docker Container State via Proxy: Set Monitor Type to
Docker Container. In the Docker Host field, select your configured Docker daemon connection pointing tohttp://docker-proxy:2375, and specify the exact container name. If the container crashes or enters an unready state, an alert triggers immediately. - TCP Port Inspection: Use the
TCP Portmonitor type for services that do not speak HTTP, such as WireGuard VPN handshakes, database listeners (port 5432 / 3306), or SSH endpoints (port 22).
Step 5: Configure Multi-Channel Push Notifications
An uptime monitor is only as effective as its dispatch system when outages occur. Uptime Kuma includes native integration with more than ninety notification providers, allowing you to route urgent downtime warnings to mobile chat clients while sending recovery notices to team webhooks.
To configure instant alerts using a private Telegram bot, follow this sequence:
- Message the official
@BotFatheron Telegram to create a new bot and obtain your HTTP API bot token. - Start a conversation with your bot, then send a message to
@userinfobotto discover your numeric Chat ID. - In Uptime Kuma, navigate to Settings > Notifications > Setup Notification.
- Select Telegram from the dropdown menu, paste your Bot Token and Chat ID, and click Test.
- Enable Default enabled so all existing and newly created monitors automatically inherit this dispatch channel.
For private homelab setups without external cloud messengers, you can pair Uptime Kuma with self-hosted Gotify or Matrix Synapse servers for zero-telemetry local network notifications.
Step 6: SSL Reverse Proxy Configuration with Nginx Proxy Manager
Exposing Uptime Kuma securely to the public internet requires an encrypted reverse proxy with full WebSocket upgrade support. Because Uptime Kuma uses Socket.io to push live heartbeat telemetry to connected browser sessions, omitting WebSocket headers results in repeated disconnect banners and broken dashboards.
If you manage your homelab proxy routes through our recommended setup in Self-Host Nginx Proxy Manager in Docker, configure the host as follows:
- Domain Names:
status.yourdomain.com - Scheme:
http• Forward Hostname / IP:127.0.0.1(or docker container IP) • Forward Port:3001 - Required Toggles: Enable Block Common Exploits and Websockets Support.
- SSL Tab: Request a new Let’s Encrypt Certificate, toggle Force SSL and HTTP/2 Support, and agree to the Terms of Service.
If you prefer standard Nginx configuration files, append the following directives inside your server block:
location / {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Mandatory WebSocket headers for Socket.io
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
For remote administrator access without opening public router firewall ports, integrate your instance with a private mesh VPN as detailed in our guide on how to self-host Headscale and WireGuard.
Step 7: Publish Branded Public Status Pages
Uptime Kuma allows administrators to generate clean, public-facing status pages that display overall infrastructure health without revealing internal IP addresses or private monitor configurations. Status pages support custom slugs, company logos, grouped service categories, and live incident updates.
To create your public dashboard:
- Click Status Pages in the top navigation bar and select New Status Page.
- Enter a descriptive title (e.g.,
Homelab System Status) and set a clean URL slug (such asstatus). - Click Add Group to create logical service categories (such as
Core Infrastructure,Media Services, andStorage & Backup). - Drag and drop your public monitors into each group. You can mark specific internal monitors as hidden while publishing public services.
- During scheduled maintenance, use the Post Incident tool to display an informational banner explaining the downtime window to your users.
Step 8: Automated SQLite Database Backup Script
All monitoring targets, SSL certificate history, notification credentials, and heartbeat logs reside inside a single SQLite file named kuma.db. Backing up this database daily guarantees that your monitoring infrastructure can be restored on a fresh server in under two minutes.
Because SQLite databases can become corrupted if copied while active write locks are held, use the native .backup command via the sqlite3 CLI utility to generate a clean transactional snapshot:
sudo apt-get install -y sqlite3
sudo tee /usr/local/bin/backup-kuma.sh << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
BACKUP_DIR="/opt/uptime-kuma/backups"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
mkdir -p "$BACKUP_DIR"
# Transaction-safe online SQLite snapshot
sqlite3 /opt/uptime-kuma/data/kuma.db ".backup '$BACKUP_DIR/kuma_$TIMESTAMP.db'"
gzip "$BACKUP_DIR/kuma_$TIMESTAMP.db"
# Retain only the last 14 daily archives
find "$BACKUP_DIR" -type f -name "kuma_*.db.gz" -mtime +14 -delete
echo "Uptime Kuma backup complete: kuma_$TIMESTAMP.db.gz"
EOF
sudo chmod +x /usr/local/bin/backup-kuma.sh
Add a daily cron entry to execute the backup script automatically at 02:30 UTC:
echo "30 2 * * * root /usr/local/bin/backup-kuma.sh >> /var/log/kuma-backup.log 2>&1" | sudo tee /etc/cron.d/kuma-backup
For offsite cloud disaster recovery, pair this snapshot routine with encrypted object storage uploads as covered in our guide on automating Vaultwarden and Restic backups to Cloudflare R2.
Architecture Tip: Local vs Off-Site Cloud Monitoring
Running a continuous 24/7 uptime monitoring instance requires stable power and reliable networking. While a local server (such as an Intel N100 mini PC or Raspberry Pi) monitors your internal LAN containers and NAS storage, external visibility requires an independent off-site probe (such as an entry-level cloud VPS) to alert you when your primary home ISP drops or local power fails.
For zero-trust networking, monitoring, and hardened container setups, visit our self-hosted Docker hub and Ubuntu server tutorials.
Troubleshooting & Frequently Asked Questions
How do I fix WebSocket disconnected errors behind Nginx?
WebSocket disconnected errors occur when your reverse proxy fails to forward HTTP upgrade headers to the Node.js backend. Ensure your proxy configuration includes proxy_http_version 1.1, proxy_set_header Upgrade $http_upgrade, and proxy_set_header Connection "upgrade". In Nginx Proxy Manager, simply toggle the Websockets Support switch on the Details tab.
Why does Docker container monitoring return permission denied?
Directly mounting the Docker socket causes permission errors if the container’s unprivileged user cannot access root-owned Unix sockets. Avoid modifying host file permissions on /var/run/docker.sock; instead, route telemetry requests through tecnativa/docker-socket-proxy on your internal Docker bridge network, granting read-only container inspection safely.
How do I update Uptime Kuma to a newer version without losing data?
Because all state and metrics reside in the persistent host volume mounted to /app/data, updating the container takes seconds. In your Compose directory, update the image tag, run docker compose pull, and execute docker compose up -d. Docker replaces the running container while preserving your SQLite database intact.
Can Uptime Kuma run behind Cloudflare Access or Zero Trust tunnels?
Yes, Uptime Kuma functions seamlessly behind Cloudflare Zero Trust tunnels (cloudflared). When configuring your public hostname in the Cloudflare Zero Trust dashboard, set the Service Type to HTTP pointing to localhost:3001, and enable No TLS Verify and HTTP2 Support under additional application settings.

Leave a Reply