Uptime Kuma is a self-hosted monitoring tool that allows you to track the status and uptime of websites, servers, and services. Running Uptime Kuma on a Raspberry Pi provides a lightweight and cost-effective solution for monitoring your infrastructure. This guide will walk you through installing and setting up Uptime Kuma on a Raspberry Pi.
What You Will Need
- Raspberry Pi (any model with GPIO support, e.g., Pi 3, Pi 4)
- MicroSD Card (at least 8GB, Class 10 or better)
- Power Supply (5V, 2.5A minimum for Pi 3; 5V, 3A for Pi 4)
- Raspberry Pi OS (Lite or Desktop version)
- Internet Connection
Step 1: Prepare the Raspberry Pi
-
Update your Raspberry Pi:
sudo apt update && sudo apt upgrade -y
-
Install necessary tools:
sudo apt install -y curl git
-
Install Docker (if not already installed):
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker $USER
Reboot your Raspberry Pi to apply the changes:
sudo reboot
Step 2: Install Uptime Kuma Using Docker
Uptime Kuma can be deployed quickly using Docker. Follow these steps to set it up:
-
Pull the Uptime Kuma Docker image:
sudo docker pull louislam/uptime-kuma:latest
-
Create a directory for persistent data:
mkdir -p ~/uptime-kuma/data
-
Run the Uptime Kuma container:
sudo docker run -d \ -p 3001:3001 \ -v ~/uptime-kuma/data:/app/data \ --name uptime-kuma \ louislam/uptime-kuma
-
Access Uptime Kuma in your browser: Navigate to
http://<raspberry-pi-ip>:3001
to access the Uptime Kuma web interface.
Step 3: Configure Uptime Kuma
-
Set up an admin account:
- On the first login, create an admin username and password.
-
Add services to monitor:
- Click on the Add New Monitor button.
- Configure the service details, such as:
- Monitor Type (HTTP(s), Ping, TCP, etc.)
- Service URL or IP address
- Interval for checks (e.g., every 5 minutes)
-
Save the monitor settings and start monitoring your services.
Step 4: Optional Enhancements
-
Enable HTTPS: Use a reverse proxy like Nginx or Traefik to secure Uptime Kuma with HTTPS.
-
Run Uptime Kuma on a Custom Port: Change the port mapping when running the Docker container:
sudo docker run -d -p 8080:3001 ...
-
Auto-start on Boot: Ensure the container starts automatically on reboot:
sudo docker update --restart unless-stopped uptime-kuma
-
Add Notifications:
- Integrate Uptime Kuma with notification services like Telegram, Slack, or email.
- Configure notifications in the Settings > Notification section of the dashboard.
Step 5: Monitor Your Infrastructure
-
View Metrics:
- Access uptime statistics, response times, and failure logs from the dashboard.
-
Set Alerts:
- Configure alerts to receive notifications if a service goes down.
-
Visualize Trends:
- Use the detailed history logs to identify patterns and optimize your services.
Troubleshooting
-
Uptime Kuma Not Accessible:
- Verify the container is running:
sudo docker ps
- Check for errors in the container logs:
sudo docker logs uptime-kuma
- Verify the container is running:
-
High Resource Usage:
- Reduce the monitoring frequency for less critical services.
- Consider upgrading to a Raspberry Pi 4 for better performance.
-
Unable to Receive Notifications:
- Double-check notification service credentials and configurations.
Applications of Uptime Kuma
- Monitor the uptime of personal websites and servers.
- Track IoT devices or home automation systems.
- Ensure cloud services and APIs are operational.
- Receive alerts for network outages or performance issues.
Conclusion
Uptime Kuma is a powerful yet lightweight monitoring tool that works seamlessly on a Raspberry Pi. With its intuitive interface and robust feature set, you can easily monitor your infrastructure and ensure everything runs smoothly. Follow this guide to set up Uptime Kuma and gain full visibility into your network and services!