DEV Community

Cover image for Self-host Uptime Kuma with Docker in 5 minutes (+ TLS-expiry alerts)
Colby Cardell
Colby Cardell

Posted on

Self-host Uptime Kuma with Docker in 5 minutes (+ TLS-expiry alerts)

If users notice your site is down before you do… that’s backwards.

Here’s the fastest way I’ve found to stand up Uptime Kuma with TLS-expiry alerts.

0) Prereqs

  • A Linux box or VPS (2 vCPU/2GB is plenty)
  • Docker & docker-compose
  • A domain or subdomain for your status page (optional)

1) Compose file

Create docker-compose.yml:

version: "3.3"
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    volumes:
      - ./kuma-data:/app/data
    ports:
      - "3001:3001"
    restart: unless-stopped
Enter fullscreen mode Exit fullscreen mode

Run it

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Open http://<server-ip>:3001 and set an admin user.

2) Add monitors fast

Add HTTP/HTTPS, port, or ping checks. I like to keep a CSV so I can bulk-add later:

name,type,url,hostname,port,interval_s
Homepage,HTTP,https://example.com,,,"60"
API Health,HTTP,https://api.example.com/health,,,"60"
DB Port,Port,,db.example.com,5432,"60"
Enter fullscreen mode Exit fullscreen mode

3) TLS-expiry alerts (30/14/7/3 days)

Add a TLS Certificate monitor for your domain, then set Notification targets:

Email (SMTP), Telegram, Discord, etc.

4) Bonus: a simple status page

In Kuma, create a Status Page and add components.

Put it behind your domain (e.g., status.example.com) with any web server.
If you’re using Caddy:

status.example.com {
  encode gzip zstd
  root * /var/www/status
  file_server
  header {
    Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "SAMEORIGIN"
  }
}
Enter fullscreen mode Exit fullscreen mode

Want the done-for-you kit?

I bundled a Uptime & SSL Monitor Kit (compose, monitor CSV template, headers checklist, status copy).
👉 https://colbycardell.gumroad.com/l/rkwrl?utm_source=devto&utm_medium=post&utm_campaign=uptime_launch&utm_content=body_cta

Top comments (0)