Virteche
Guideschevron_rightServers

Servers · 6 min read · Updated

How to Self-Host Uptime Kuma for Website Monitoring

Uptime Kuma is a free, self-hosted monitoring tool: it checks your websites, APIs and servers every minute and alerts you through email, Discord, Telegram or Slack when one stops answering. Run it in Docker with one compose file, put it behind Nginx with HTTPS, and create the admin account straight away. It can also publish a public status page for your customers. Run it on a different server from the ones it watches, or an outage takes the monitor down too.

1. Install Docker

Follow How to run Docker and Docker Compose on a VPS, then point a name such as status.example.com at the server with an A record.

2. Write the Compose File

mkdir -p ~/uptime-kuma && cd ~/uptime-kuma
nano compose.yaml
services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    restart: unless-stopped
    ports:
      - "127.0.0.1:3001:3001"     # only reachable through Nginx
    volumes:
      - ./data:/app/data
docker compose up -d
docker compose logs -f        # wait until it is listening, then Ctrl+C

3. Put Nginx and HTTPS in Front

Follow steps 2 to 4 of How to host a website on a VPS with status.example.com, and use its reverse proxy block with port 3001. Uptime Kuma's dashboard updates live over WebSockets, so keep the Upgrade and Connection headers:

location / {
    proxy_pass http://127.0.0.1:3001;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
}

Open https://status.example.com. If it first asks which database to use, choose SQLite, which is plenty for one server. Then create the admin account immediately: until you do, whoever opens the page first can create it.

4. Add Monitors and Alerts

  1. Settings → Notifications: add where alerts should go (email over SMTP, a Discord webhook, a Telegram bot) and send a test.
  2. Add New Monitor: type HTTP(s) for a website, with a 60-second interval. Turn on certificate expiry notification so you hear about an expiring certificate before visitors do.
  3. Add a TCP Port or Ping monitor for servers that do not serve a website, such as a database or game server.

To send email alerts, use your email provider's SMTP server on port 587 or 465. Outgoing connections on port 25 are blocked on Virteche Cloud.

5. Publish a Status Page

Under Status Pages, create a page, choose which monitors it shows, and give it its own address. Customers can check it during an incident instead of opening a ticket to ask.

6. Back Up and Update

cd ~/uptime-kuma
docker compose pull && docker compose up -d     # update
tar -czf ~/uptime-kuma-$(date +%F).tar.gz data  # back up the monitors and history

Stop the container first (docker compose stop) for a fully consistent copy of its database, or include ~/uptime-kuma in a nightly Borg backup.

Common Questions

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

    No. If that server goes down, so does the monitor, and nothing tells you. Run Uptime Kuma on a separate small VPS, ideally in a different location from what it watches.

  • How big a server does it need?

    Very little. Hundreds of checks every minute fit in 1 GB of memory. The smallest VPS plan is more than enough, and can run other small tools alongside it.

  • What can it check?

    Websites and APIs over HTTP(S), including the response text and the certificate's expiry, plus TCP ports, ping, DNS records, Docker containers and more. Each check can alert through email, Discord, Telegram, Slack and many other services.

A small KVM server in Ashburn or Dallas is plenty for Uptime Kuma, away from the servers it watches.

See VPS plans

Keep Reading

All guides