Introduction
Uptime Kuma is an open-source, self-hosted monitoring tool. It helps you track the uptime, response time, and availability of your websites, APIs, servers, and other network resources.
In this tutorial, I’ll walk through deploying Uptime Kuma using Docker Compose with persistent storage, making it easy to set up and manage.
Prerequisites
Before starting, ensure you have:
- A Linux server (Ubuntu, Debian, CentOS, etc.)
- Docker installed
- Docker Compose installed
Directory Setup
We’ll keep all Uptime Kuma files under /your-desired-folder/uptime-kuma
.
sudo mkdir -p /your-desired-folder/uptime-kuma/data
cd /your-desired-folder/uptime-kuma
Directory structure:
/your-desired-folder/
└── uptime-kuma/
├── data/
└── docker-compose.yml
Docker Compose File
Create a docker-compose.yml
inside /your-desired-folder/uptime-kuma
:
version: '3.8'
services:
uptime-kuma:
image: louislam/uptime-kuma
container_name: uptime-kuma
volumes:
- /your-desired-folder/uptime-kuma/data:/app/data
ports:
- "your-desired-port:3001"
restart: always
Explanation
- image: louislam/uptime-kuma → Uses the official Uptime Kuma Docker image.
- container_name → Assigns a fixed container name for easy management.
-
volumes → Maps
/your-desired-folder/uptime-kuma/data
(host) →/app/data
(container) for persistent storage. -
ports: "your-desired-port:3001" → Exposes Kuma’s web UI on port
your-desired-port
of the host.- Access via:
http://<your-server-ip>:your-desired-port
- Access via:
restart: always → Automatically restarts if the container stops or after a server reboot.
Deploy Uptime Kuma
Run:
docker-compose up -d
Check container status:
docker ps
View logs:
docker logs -f uptime-kuma
Accessing the Dashboard
Once the container is running, open a browser and visit:
http://<your-server-ip>:your-desired-port
On first launch, you’ll be prompted to create an admin account.
Managing Uptime Kuma
- Start service
docker-compose up -d
- Stop service
docker-compose down
- Update to latest version
docker-compose pull
docker-compose up -d
Best Practices
- Use an NGINX reverse proxy with Let’s Encrypt for HTTPS instead of exposing Uptime Kuma directly on port
your-desired-port
. - Regularly back up
/your-desired-folder/uptime-kuma/data
to avoid losing configs and monitoring history. - Restrict access via firewall if your server is exposed to the internet.
Conclusion
You now have Uptime Kuma running with Docker Compose. With this setup, you can monitor your infrastructure and services easily, while keeping everything self-hosted and under your control.
Top comments (0)