All posts

Blog

How to Self-Host Uptime Kuma on a VPS for Website Monitoring

Illustrated cover for the Servers & VPS guide "How to Self-Host Uptime Kuma on a VPS for Website Monitoring"

Paid uptime monitoring services are convenient, but their free tiers tend to limit how many checks you get and how often they run. If you already have a small VPS, there is an appealing alternative: Uptime Kuma, an open-source, self-hosted monitoring tool with a clean dashboard, dozens of notification options and built-in public status pages.

This guide shows you how to self-host Uptime Kuma on a VPS with Docker, put it behind Nginx with HTTPS, and configure monitors that actually tell you something useful. If you are still deciding between hosted and self-hosted monitoring, our overview of uptime monitoring tools covers the trade-offs.

Rule number one: monitor from somewhere else

A monitor that lives on the same server as your website goes down at the same moment your website does, and then it can't alert anyone. Run Uptime Kuma on a separate VPS, ideally with a different provider or in a different data center from the sites it watches. A small, inexpensive VPS is plenty for monitoring a handful of sites.

What Uptime Kuma can check

Uptime Kuma supports many monitor types, including:

  • HTTP(S): is the page responding with a success status code?
  • HTTP(S) keyword: does the page contain (or not contain) a specific word, so you catch "200 OK but broken" pages?
  • TCP port: is a service such as a database or mail server accepting connections?
  • Ping: is the host reachable?
  • DNS: does a record resolve to the expected value?
  • Docker container: is a container on the same host running?
  • Push: your cron job or script calls a URL, and Uptime Kuma alerts you if the call stops arriving.

It also warns you before SSL certificates expire, which is easy to overlook.

What you need

Uptime Kuma can also run without Docker using Node.js, but Docker is the simplest to install and upgrade.

Step 1: Run Uptime Kuma with Docker

Uptime Kuma's official README shows a single docker run command. Image tags change between major versions, so check the project README on GitHub for the current recommended tag. A typical command looks like this:

docker run -d \
  --name uptime-kuma \
  --restart=unless-stopped \
  -p 127.0.0.1:3001:3001 \
  -v uptime-kuma:/app/data \
  louislam/uptime-kuma:2

Some notes on this command:

  • -p 127.0.0.1:3001:3001 publishes the port only on localhost. That matters, because ports Docker publishes on all interfaces can bypass firewall rules such as UFW. Nginx will handle public traffic instead.
  • -v uptime-kuma:/app/data stores your settings and history in a named Docker volume, so they survive upgrades.
  • The project warns against storing the data folder on network file systems like NFS, because the database can become corrupted. Keep it on local disk.

If you prefer Docker Compose, the same settings go in a compose.yaml file. The repository includes an example.

Step 2: Put it behind Nginx with HTTPS

Install Nginx and create a server block for your subdomain, for example /etc/nginx/sites-available/uptime-kuma:

server {
    listen 80;
    server_name status.example.com;

    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
    }
}

The Upgrade and Connection headers are essential. Uptime Kuma's dashboard uses WebSockets, and without these headers it will load but never update.

Enable the site and reload Nginx:

sudo ln -s /etc/nginx/sites-available/uptime-kuma /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Then add a free certificate with Certbot, as shown in our Let's Encrypt with Certbot guide:

sudo certbot --nginx -d status.example.com

Step 3: Create your admin account immediately

Visit https://status.example.com. The first screen asks you to create an admin account. Do this right away, because until you do, anyone who finds the page could claim it. Use a strong, unique password, and then enable two-factor authentication in the settings.

Step 4: Add your first monitors

Click Add New Monitor and start with the basics:

  1. Homepage (HTTP keyword): your site's URL, with a keyword that only appears when the page renders correctly, such as text from your footer.
  2. Checkout or login page: if you run a store or membership site, monitor the page that makes money.
  3. SSL expiry: enable certificate expiry notifications on your HTTPS monitors.
  4. Mail server (TCP port): if you run your own mail, check port 465 or 587.
  5. Backups (Push): add a push monitor and have your backup script call its URL at the end of each successful run. If a backup silently fails, you'll hear about it.

Set a sensible heartbeat interval (60 seconds is a common choice) and a retry count of two or three, so a single network blip doesn't wake you up at night.

Step 5: Set up notifications

Uptime Kuma supports a long list of notification services, including email (SMTP), Slack, Discord, Telegram, Microsoft Teams, Pushover, ntfy and webhooks. Go to Settings > Notifications, add at least one channel, and use the Test button to confirm it works.

Good practice:

  • Use two channels for critical sites, for example email plus a phone push notification.
  • Apply notifications to every monitor (there is a "Default enabled" option).
  • Avoid alert fatigue. If a monitor flaps constantly, fix the cause or tune the retries rather than ignoring it.

Step 6: Publish a status page (optional)

Uptime Kuma can host public status pages. Create one under Status Pages, choose which monitors to show, and give it a slug. You can even map it to its own domain. A status page lets customers check whether a problem is on your end, which can cut down on support emails during an outage.

Only show monitors that make sense to the public. Internal services and database ports usually don't belong there.

Keeping Uptime Kuma updated and backed up

To upgrade a docker run install, pull the new image, then remove and recreate the container with the same volume:

docker pull louislam/uptime-kuma:2
docker stop uptime-kuma && docker rm uptime-kuma
# re-run the docker run command from Step 1

Before major version upgrades, read the release notes on GitHub, since they can include database migrations. Back up the data volume regularly, for example by stopping the container briefly and archiving the volume's contents, or by using the backup options in the app if your version provides them.

Wrapping up

Uptime Kuma gives you a capable, self-hosted monitoring dashboard for the cost of a small VPS. Run it away from the servers it watches, keep its port bound to localhost behind Nginx with HTTPS, claim the admin account immediately, and set up monitors that check what matters: keywords, checkout pages, certificates and backups. Then make sure at least one alert channel reaches you wherever you are.