How to Set Up Uptime Kuma with Docker Compose for Real-Time Service Monitoring
Learn how to deploy Uptime Kuma using Docker Compose to monitor your self-hosted infrastructure with real-time alerts and status pages.
Disclosure: this article contains an affiliate link. DotExe may earn a commission if you purchase through it, at no extra cost to you. Any discount is subject to Hostinger's current offers (20% OFF) and eligibility terms.
Monitoring your infrastructure is a critical task for any self-hoster or developer. Uptime Kuma has emerged as the industry standard for lightweight, self-hosted status monitoring, offering a beautiful dashboard and support for various notification channels. By using uptime kuma docker compose, you can deploy a robust monitoring solution that persists your configuration and handles service checks with ease.
Prerequisites
Before you begin, ensure you have Docker and Docker Compose installed on your host machine. If you are managing your services on a remote VPS, you might consider Hostinger Web Hosting to host your monitoring stack. You should also have a basic understanding of how to manage YAML configuration files.
Creating the Docker Compose Configuration
To get started, create a directory for your Uptime Kuma instance. Inside this directory, create a file named docker-compose.yml. This file defines the service, maps the necessary ports, and ensures your data persists across container restarts.
version: "3.8"
services:
uptime-kuma:
image: louislam/uptime-kuma:latest
container_name: uptime-kuma
restart: always
ports:
- "3001:3001"
volumes:
- ./uptime-kuma-data:/app/data
In this configuration, we map port 3001 on the host to port 3001 inside the container. The volumes section ensures that your monitors, settings, and history are stored in a local folder named uptime-kuma-data.
Deploying the Container
Once your configuration file is ready, navigate to the directory in your terminal and run the following command to start the service:
docker compose up -d
Docker will pull the latest image and start the container in the background. You can verify that the container is running by executing docker ps. If you encounter issues, you might want to check the logs using docker logs uptime-kuma to troubleshoot potential startup errors, similar to how you would approach debugging-docker-container-exits.
Configuring Monitors and Notifications
After the container is up, access the dashboard by navigating to http://<your-server-ip>:3001 in your browser. You will be prompted to create an administrator account. Once logged in, you can add your first monitor. Uptime Kuma supports HTTP(s), TCP, Ping, and keyword monitoring.
To receive alerts, navigate to the "Notifications" tab in the settings. You can integrate services like Discord, Telegram, or Email. This ensures that you are immediately notified if a service goes down, allowing you to maintain high availability for your projects.
Conclusion
Deploying Uptime Kuma with Docker Compose provides a reliable and easy-to-maintain monitoring system for your homelab or production environment. By centralizing your service health checks, you gain visibility into your infrastructure and can respond to outages before they impact your users.
Frequently Asked Questions
Can I run Uptime Kuma on a remote server?
Yes, you can deploy Uptime Kuma on a remote VPS using the same Docker Compose configuration provided in this guide. Ensure that port 3001 is open in your firewall settings to access the dashboard.
How do I ensure my monitoring data is not lost?
The configuration includes a volume mapping that stores all application data in a local folder named uptime-kuma-data. This ensures that your monitors and settings persist even if the container is removed or updated.
What types of services can Uptime Kuma monitor?
Uptime Kuma supports a wide range of checks including HTTP(s) requests, TCP ports, ICMP pings, and keyword matching on web pages. You can select the appropriate monitor type when adding a new service in the dashboard.