Learn how to set up Uptime Kuma, a free, self-hosted uptime monitoring solution, using Docker Compose. This step-by-step guide will help you deploy and configure the tool to ensure you're notified when services go offline.
Prerequisites for Uptime Kuma Deployment
Before proceeding, ensure you meet the following requirements:
prerequisites
- A system with Docker installed and running.
- Docker Compose installed on the system for container management.
- A separate host system for Uptime Kuma to ensure it can monitor services independently, even if one monitored system goes offline.
Setting Up Uptime Kuma Using Docker Compose
Follow these steps to deploy Uptime Kuma using Docker Compose:
steps
Create a directory to hold Uptime Kuma’s configuration:
bashmkdir uptime-kuma cd uptime-kumaCreate a
docker-compose.ymlfile inside this directory with the following content:yamlversion: "3" services: uptime-kuma: image: louislam/uptime-kuma:latest container_name: uptime-kuma ports: - "3001:3001" volumes: - ./data:/app/data restart: alwaysLaunch the Uptime Kuma container:
docker-compose up -d
# Output: Creating uptime-kuma ... done - Confirm the container is running:
docker ps
# Output: uptime-kuma | Running | Exposed Port 3001 Initial Configuration for Uptime Kuma
After deployment, access the web interface to set up the monitoring system.
steps
- Open a browser and go to
http://<Docker-host-IP>:3001. - Create the admin account by setting a username and password.
- Begin adding monitors by grouping services logically based on criteria such as host type or service function.
- Save the configuration for efficient management.
Monitoring Services and Devices
Uptime Kuma supports various monitoring options, including Docker containers, web services, and more.
steps
Add a new monitor by selecting the type, such as:
- Docker container: Monitor specific containers on a host.
- HTTP(S): Check web service status.
- Ping: Test network devices like IP cameras.
Adjust the heartbeat interval:
- Default: 60 seconds.
- Use a lower interval (e.g., 20 seconds) for critical services.
Set retries to reduce false alarms for intermittent downtime. For instance, set retries to
3for sporadically unstable services.Group monitors logically (e.g., all Docker containers under one group, or services grouped by functionality).
Setting Up Notifications for Service Alerts
Notifications ensure you receive outage alerts promptly. Configure as follows:
steps
Navigate to Notifications in the settings menu.
Select a notification method (e.g., Home Assistant, email, SMS).
Enter the necessary credentials and test the configuration.
Enable default notifications for all monitors or set per-service preferences.
Example: Configure Home Assistant JSON-based notifications for granular control.
Verifying and Managing Uptime Kuma Monitoring
Test your setup to ensure everything works correctly.
steps
- Stop a monitored service or Docker container to simulate downtime.
- Observe if the monitor correctly reflects the downed service in the dashboard.
- Ensure notification retries and alert thresholds are functioning as configured.
- Update or fine-tune monitors and notifications based on real-time conditions.
FAQ
How do I monitor Docker containers in Uptime Kuma?
To monitor Docker containers, add a Docker monitor in the Uptime Kuma dashboard. Ensure the container's name matches precisely and test connectivity. Group containers logically for easier management.
Should Uptime Kuma be on the same system as monitored services?
No. Hosting Uptime Kuma on the same system creates a single point of failure. Use a separate machine or virtual infrastructure.
Can I monitor services behind self-signed SSL?
Yes. When setting up an HTTPS monitor, you can choose to ignore SSL certificate errors to accommodate self-signed certificates.
Official reference: Uptime Kuma.