composebuilder

Docker Compose: Uptime Kuma Status Monitoring

Self-host Uptime Kuma in Docker Compose to monitor websites, ports and APIs with alerts. Pinned image, persistent data volume and a localhost-only port binding.

When to use this stack

Uptime Kuma is a self-hosted monitoring tool with a clean web interface. You define monitors for websites, APIs, TCP ports and other services, choose how often each one is checked, and receive a notification when a check starts or stops failing. It also draws response time graphs and can publish a status page for your users. This stack runs it as a single container with its data in a named volume and its port bound to localhost.

Use this stack when you want to know quickly when your websites, APIs or servers stop responding, and you prefer to host the monitor yourself. It suits a small business or a developer with a handful of public services, and it is a good first step before adding metrics from the Prometheus stack. Do not rely on it alone for critical systems, because a monitor that runs on the same host it checks cannot report that host going offline. Do not publish a status page or the admin panel without protection, since the panel can reveal your full list of services. Also do not use Docker-type monitors unless you accept that they need access to the Docker socket, which is a serious privilege.

docker-compose.yml

services:
  uptime-kuma:
    image: louislam/uptime-kuma:1.23.16
    restart: unless-stopped
    environment:
      TZ: ${TZ}
    ports:
      - "127.0.0.1:${UPTIME_KUMA_PORT}:3001"
    volumes:
      - uptime_kuma_data:/app/data

volumes:
  uptime_kuma_data:

.env

.env
# Host port for the web UI, bound to 127.0.0.1
UPTIME_KUMA_PORT=3001

# Time zone used for the dashboard and the notification timestamps
TZ=Europe/Madrid

Start and verify

Shell
# Save the blocks above as docker-compose.yml and .env
docker compose config --quiet
docker compose up -d
docker compose ps
docker compose logs --tail=30 uptime-kuma

# The port is bound to localhost, so check it from the server
curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3001/

# Open an SSH tunnel from your computer to reach the setup page
# ssh -L 3001:127.0.0.1:3001 youruser@your-server
# then open http://localhost:3001 and create the admin account

On the first visit, create the admin account. Then add a first monitor for a site you own, set the interval to 60 seconds, and send a test notification from the notification settings to confirm the channel works.

Production checklist

  • Keep the port bound to 127.0.0.1 and place an HTTPS reverse proxy in front of it if you need remote access. Do not publish the admin panel on the open internet without TLS.
  • Create the admin account immediately after the first start, and use a long password that you do not reuse elsewhere.
  • Run at least one external check from another machine or a free external monitoring service, so an outage of this server is also detected.
  • Store notification tokens and SMTP passwords only in the notification settings, and rotate them if the database is copied to another system.
  • Back up uptime_kuma_data regularly, because the SQLite database holds every monitor, notification and status page.
  • Avoid the Docker monitor type unless it is essential. It requires the Docker socket, and that access is equivalent to root on the host.
  • Pin the 1.23 image tag and read the upgrade notes before moving to a new major version, since the data format and settings may change.
  • Limit outbound access if your server policy requires it, and allow only the notification endpoints you use.

Common problems

  • Symptom: A monitor for another container shows DOWN even though the service works. Cause: The monitor uses localhost, which points at the Uptime Kuma container. Fix: Use the service name, for example http://app:8080, when both containers share a network.
  • Symptom: The web page does not open from your computer. Cause: The port is bound to 127.0.0.1, which is intentional. Fix: Create an SSH tunnel, or place a reverse proxy with HTTPS in front of it.
  • Symptom: Notifications never arrive. Cause: Outbound traffic is blocked by a firewall, or the token or SMTP credentials are wrong. Fix: Use the “Test” button in the notification settings and check the container logs for the error.
  • Symptom: The dashboard shows the wrong times. Cause: TZ was not set in .env, so the container uses UTC. Fix: Set TZ, then run docker compose up -d to recreate the container.
  • Symptom: You lost the admin password. Cause: No second administrator exists and the password was not saved. Fix: Restore a backup of uptime_kuma_data, or follow the official reset procedure for version 1.23.

Variations

  • Behind Caddy or Traefik: Attach the Uptime Kuma container to the same network as the proxy and route a subdomain to uptime-kuma:3001 with HTTPS.
  • Public status page: Create a status page for customers on a separate hostname, and keep the admin hostname restricted to your own IP addresses or to a VPN.
  • Version 2: When the version 2 image is stable and you have tested your monitors, switch the tag and migrate on a copy of the data first.

Questions

What can Uptime Kuma monitor?

It checks HTTP and HTTPS endpoints, TCP ports, DNS records, ping targets and many service types, then sends notifications through channels such as email, Telegram or webhooks.

Should I run the monitor on the same server it watches?

Not for the most important checks. If the server goes down, the monitor goes down with it. Run a second monitor on another machine or use an external service to watch the first one.

Where is the monitoring data stored?

Uptime Kuma keeps its SQLite database and settings in the /app/data folder, which this stack maps to the uptime_kuma_data volume.

Why can the container not reach localhost services?

Inside the container, localhost refers to the container itself. Use the service name on the Docker network or the server's LAN address instead.

Adapt this stack

Load these files into the builder to rename services, change ports, add a cache or a proxy, and generate fresh passwords for the .env.

Open in builder
  • Caddy 2 Reverse Proxy + Static Web Server

    Caddy 2 in Docker Compose: serve a static site, proxy /api to a backend and get automatic HTTPS on a real domain. Pinned images and .env configuration.

    • caddy
    • whoami
    Difficulty: Beginner
  • Gitea Git Server with PostgreSQL 16

    Self-hosted Gitea with PostgreSQL 16 in Docker Compose: web Git hosting, SSH on port 2222, a healthcheck-gated database start and persistent volumes.

    • gitea
    • db
    Difficulty: Intermediate
  • Loki, Promtail and Grafana Log Stack

    Collect Linux host logs with Loki and Promtail in Docker Compose and query them in Grafana. Pinned images, persistent volumes and a localhost-only Grafana port.

    • loki
    • promtail
    • grafana
    Difficulty: Intermediate
  • Portainer CE Web UI for Docker Management

    Run Portainer CE in Docker Compose as a web UI for containers, images and volumes. Bound to localhost on HTTPS 9443, with persistent data and a pinned image.

    • portainer
    Difficulty: Intermediate

Browse more Infrastructure & Monitoring stacks or the full library.