How to Install Uptime Kuma with Caddy on Ubuntu 20.04

A few weeks ago, one of my client’s sites suddenly went down. I had no idea until users started reporting the issue. That’s when I realized how crucial it is to have real-time site monitoring. When a site goes down, it’s not just visitors you lose; your reputation and revenue can take a hit too. I’ve always been looking for a simple and reliable solution that’s both lightweight and easy to use. That’s why I chose Uptime Kuma; a lightweight, open-source tool that checks servers, sites, and APIs in real time. When you combine this with Caddy, which automatically manages HTTPS, you have a secure and reliable monitoring system with very little hassle. In this guide, I’m going to show you step-by-step how I Install Uptime Kuma with Caddy on Ubuntu 20.04, along with my experiences and lessons learned, common mistakes, and practical tips that go beyond a typical installation.
Why Uptime Kuma and Caddy?
This combination is really great for small and medium-sized servers:
1- Instant notification: You will be notified as soon as something goes wrong.
2- Lightweight: It runs smoothly even on a VPS with 1GB of RAM.
3- Easy setup: It installs with Docker and Caddy handles HTTPS.
4- Comprehensive monitoring: HTTP(S), TCP, ICMP, DNS, and even custom scripts.
Real world experience: When I first installed Uptime Kuma for my friend’s e-commerce site, the system detected a problem that had been ignored for years within 24 hours. Instant notifications helped to fix the problem quickly and avoid losing sales.
Tip: For small teams, installing Uptime Kuma is the fastest way to see the status of sites and servers in real time.
What do you need before you start?
1- A VPS with Ubuntu 20.04 and root or sudo access, so you can easily manage everything.
2- Minimum specs: 1 vCPU, 1GB RAM, and 10GB storage, which is enough for this installation.
3- An active domain pointing to your server IP, so that the online monitoring tool is available.
Part One: Install Caddy
Instead of just giving you the command, I proceeded like this:
1- I updated the server and installed the necessary packages.
2- I added the GPG key and Caddy repository.
3- I installed Caddy.
Then I created a simple reverse proxy in the Caddyfile:
monitor.example.com { reverse_proxy localhost:3001 }
I restarted Caddy, and everything was ready.
Lesson learned from this step: You should be careful that using a separate subdomain like monitor.example.com keeps monitoring separate from the main site.
Part Two: Install Uptime Kuma with Docker
I prefer Docker because it is easier to update and move. So update the server:
sudo apt update && sudo apt upgrade -y
Install Docker:
sudo apt install docker.io -y
Create a volume to store data:
docker volume create uptime-kuma
Run the container:
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
Next simple update:
docker pull louislam/uptime-kuma:1 docker stop uptime-kuma docker rm uptime-kuma docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
Note: Always have a backup of the volume to avoid data loss.
Part Three: SSH and Firewall Security
To reduce automated attacks, I changed the default SSH port:
sudo nano /etc/ssh/sshd_config Port 1337 sudo systemctl reload sshd
Then I opened the necessary ports in the firewall:
ufw allow 1337/tcp ufw allow 80/tcp ufw allow 443/tcp ufw enable
Personal tip: Be aware that even small changes can greatly improve server security.
Part Four: Complete Caddy Configuration
I updated the subdomain Caddyfile to look like this:
monitor.example.com { reverse_proxy 127.0.0.1:3001 }
After restarting Caddy, everything was ready to go.
Part Five: Access the Kuma Uptime Interface
Open your browser and go to https://monitor.example.com. I created an account and started adding monitors. Within minutes, I was monitoring my sites and servers live and receiving instant notifications when they went down.
Lessons and best practices
1- Port conflicts: Make sure the ports are free before you start.
2- SSL errors: Make sure DNS is fully published; Caddy handles that for you.
3- Data backups: Back up your Docker volumes regularly.
4- Security: Keep Docker, Ubuntu, and Uptime Kuma up to date.
5- Notifications: For instant responses, set up notifications via Telegram, Discord, or email.
Conclusion: Install Uptime Kuma with Caddy on Ubuntu 20.04
Installing Uptime Kuma with Caddy on Ubuntu completely changed my experience of monitoring servers! Live notifications, secure HTTPS, and flexible monitoring make it possible to have a professional system even on small VPS. Remember!! regular updates, properly configured notifications, and monitoring for new services are key to keeping sites and servers healthy. Uptime Kuma is not just software; it is a proactive system that saves you time, prevents outages, and keeps your online presence secure.
Caddy is a lightweight and modern web server that supports HTTPS by default and has simpler configuration than Nginx or Apache. If you are looking for a fast, secure, and hassle-free setup of Uptime Kuma, using Caddy is a smart choice.
Yes, it is possible; but it is recommended to use a valid domain with HTTPS. Using a domain (with the help of Caddy and Cloudflare DNS) increases security and makes the monitoring panel easier to access.
Uptime Kuma can be installed both with Docker and traditionally (from source), but using Docker is much easier, faster, and more reliable. For this reason, this tutorial uses the Docker method to make installation and updates easier.
You might like it
cPanel Tutorials
How to Install CloudLinux mod_lsapi PRO on cPanel
Ubuntu Tutorials
How to Enable Coolbits on Ubuntu 22.04
Almalinux Tutorials
How to Run Python 2.7 on AlmaLinux 9