8.2.19 Deploying Uptime Kuma
Uptime Kuma is a lightweight self-hosted monitoring system (HTTP/HTTPS, TCP, ICMP, DNS, PUSH) that displays service uptime in real time and sends notifications in case of failures. This guide will help you quickly deploy it on Ubuntu 22.04/24.04 using Docker Compose — without manual dependency installation.
Benefits
- 24×7 monitoring of website / API / server availability
- Instant alerts via Telegram, Discord, Slack, Email, Pushover
- Unified dashboard with latency charts and incident logs
Server Preparation
Requirements
- Virtual or Dedicated Server
- Minimum 1 vCPU, 1 GB RAM, 5 GB SSD
- Root access or a user with sudo privileges
- Docker and Docker Compose must be installed beforehand
Variables to Replace
DATA
— path to store data (e.g./opt/uptime-kuma
)HTTP_PORT
— external port (default is3001
)YOUR_DOMAIN
— domain name, if using a reverse proxySERVER_IP
— your server’s IP address
Create Working Directory and Network
sudo mkdir -p /home/uptimeKuma/data
sudo chown -R $USER:$USER /home/uptimeKuma/data
If needed, create a dedicated Docker network for monitoring services:
docker network create monitor-net
Security
Only open the port that will be used for the web interface.
UFW:
sudo ufw allow HTTP_PORT/tcp # HTTP UI
sudo ufw reload
iptables:
sudo iptables -A INPUT -p tcp --dport HTTP_PORT -j ACCEPT
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -P INPUT DROP
Installation
Create the docker-compose.yml
file:
version: "3.9"
services:
uptime-kuma:
image: louislam/uptime-kuma
container_name: uptime-kuma
restart: unless-stopped
volumes:
- ./data:/app/data
networks:
- monitor-net
ports:
- "HTTP_PORT:3001"
networks:
monitor-net:
external: true
Explanation of parameters:
louislam/uptime-kuma:2
— locks version to v2 to avoid breaking changes from updatesvolumes
— stores database, configs, and backups outside the containerrestart: unless-stopped
— ensures container auto-starts after server reboot
Now launch the stack. Compose will download the image (~200 MB) and start the container:
cd /home/uptimeKuma/data
docker compose up -d
Automatic Updates with Watchtower
Watchtower checks for image updates every 6 hours and restarts containers when new versions are available:
docker run -d --name watchtower \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--cleanup --interval 21600
Verification
- Open your browser:
http://SERVER_IP:HTTP_PORT
- Create an admin account and log in to the dashboard.
- Add a test monitor (e.g.,
https://google.com
) and verify the status is UP.
- Check container logs:
docker compose logs -f uptime-kuma
Common Issues
Problem | Symptoms | Solution |
---|---|---|
Port already in use | bind: address already in use in logs |
Change HTTP_PORT or stop another service using the same port. |
Permission denied when writing data | Container exits with code 13 | Check ownership of the DATA directory and run chown $USER:$USER . |
UI inaccessible via domain | 502/404 error from reverse proxy | Ensure Nginx is configured with upstream http://127.0.0.1:HTTP_PORT and reload nginx. |
Container crashes after a few days | OOM Killed in docker inspect |
Increase RAM or set mem_limit / memswap_limit in Compose. |
Official Documentation