Skip to content

Uptime Kuma

Uptime Kuma is a status monitoring service that can expose a page with your services' uptime status.

There is an official image for this service that we'll use: louislam/uptime-kuma.

Pre-Installation

We'll create a folder in the main user's home where all the service's data will be saved.

mkdir ~/services/observability/uptime-kuma

Docker Compose

Uptime Kuma will be run using Docker Compose. The content of the docker-compose.yml file is as follows:

services:
  web:
    image: louislam/uptime-kuma:latest
    restart: unless-stopped
    networks:
      default:
      proxy_external:
        aliases:
          - uptime-kuma
    volumes:
      - ./data:/app/data
    environment:
      TZ: America/Guayaquil
    labels:
      traefik.enable: true
      traefik.docker.network: proxy_external
      traefik.http.routers.uptime-kuma-http.rule: Host(`${DOMAIN_UPTIME_KUMA}`)
      traefik.http.routers.uptime-kuma-http.entrypoints: http
      traefik.http.routers.uptime-kuma-http.middlewares: uptime-kuma-redirectscheme
      traefik.http.routers.uptime-kuma-http.service: uptime-kuma@docker
      traefik.http.routers.uptime-kuma-https.rule: Host(`${DOMAIN_UPTIME_KUMA}`)
      traefik.http.routers.uptime-kuma-https.entrypoints: https
      traefik.http.routers.uptime-kuma-https.service: uptime-kuma@docker
      traefik.http.routers.uptime-kuma-https.middlewares: uptime-kuma-headers
      traefik.http.routers.uptime-kuma-https.tls: true
      traefik.http.routers.uptime-kuma-https.tls.certresolver: le
      traefik.http.services.uptime-kuma.loadbalancer.server.port: 3001
      traefik.http.middlewares.uptime-kuma-redirectscheme.redirectscheme.scheme: https
      traefik.http.middlewares.uptime-kuma-redirectscheme.redirectscheme.permanent: true
      traefik.http.middlewares.uptime-kuma-headers.headers.customrequestheaders.X-Forwarded-Proto: https
      traefik.http.middlewares.uptime-kuma-headers.headers.customrequestheaders.Host: ${DOMAIN_UPTIME_KUMA}

networks:
  proxy_external:
    external: true

Secrets

Make sure to create a .env file with the following structure:

DOMAIN_UPTIME_KUMA=

Reverse Proxy

This service is exposed by a reverse proxy. More specifically, it is using Traefik.

For this reason, you will see that this service has:

  1. A directive to connect it to the proxy_external external network.
  2. A container alias for the proxy_external network.
  3. A number of labels with names starting with traefik.

If you're not using a reverse proxy, feel free to remove these from the docker-compose.yml file. Keep in mind you might need to bind the ports to connect to the service instead.

Running

Start up the service with:

docker compose up -d

That's it! The service will auto-start on system startup and restart on failure.