How to Install Uptime Kuma on Docker with Docker Compose
Uptime Kuma is an open-source, self-hosted monitoring tool designed to keep track of the uptime status of your websites, servers, and services. With its user-friendly interface, Uptime Kuma provides real-time monitoring, alerts, and historical data. One of the most efficient ways to deploy Uptime Kuma is by using Docker and Docker Compose. This guide will walk you through the steps to install Uptime Kuma on Docker with Docker Compose, ensuring a smooth and hassle-free setup.
Prerequisites
Before you begin, ensure that your system meets the following prerequisites:
- Docker: Installed on your machine. Docker is a platform that allows you to run applications in isolated environments called containers.
- Docker Compose: Installed on your machine. Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file.
Step 1: Set Up a Working Directory
First, create a directory on your server or local machine where the Docker Compose file and related data will be stored. This directory will also house the data for Uptime Kuma.
mkdir uptime-kuma
cd uptime-kuma
Step 2: Create the Docker Compose File
In the newly created directory, create a file named docker-compose.yml
. This file will define the Uptime Kuma service, along with the necessary configurations.
vi docker-compose.yml
services:
uptime-kuma:
image: louislam/uptime-kuma:latest
container_name: uptime-kuma
volumes:
- ./uptime-kuma-data:/app/data
ports:
- "1337:3001"
restart: always
networks:
default:
name: sites
external: true:
Step 3: Launch Uptime Kuma
With the docker-compose.yml
file ready, you can now deploy Uptime Kuma by running the following command in your terminal:
docker-compose up -d
This command will download the Uptime Kuma image, create a container, and start it in detached mode. The -d
flag runs the container in the background, freeing up your terminal.
Step 4: Access Uptime Kuma
Once the container is up and running, you can access Uptime Kuma through your web browser. Navigate to http://your-server-ip:3001
or http://your-server-ip:1337
.
Step 5: Configure Uptime Kuma
Upon first access, Uptime Kuma will prompt you to set up an administrator account. Enter the required details, such as username, password, and email address, and follow the on-screen instructions to complete the setup.
After creating the admin account, you’ll be directed to the dashboard, where you can start adding services to monitor. Uptime Kuma supports HTTP(s), TCP, Ping, DNS, and push monitoring out of the box. You can configure notification channels for alerts, set custom intervals, and view historical data for each monitored service.
Step 6: Managing Uptime Kuma with Docker Compose
Managing Uptime Kuma with Docker Compose is straightforward. Here are a few essential commands you might need:
- Stop the container:
docker-compose down
This command stops and removes the Uptime Kuma container but keeps the data intact.
- Update Uptime Kuma:
docker-compose pull
docker-compose up -d
This sequence pulls the latest version of Uptime Kuma and restarts the container.
- View logs:
docker-compose logs -f
- This command displays real-time logs from the Uptime Kuma container.
Conclusion
Installing Uptime Kuma using Docker and Docker Compose is a simple and efficient way to set up a robust monitoring solution for your infrastructure. The steps outlined in this guide should help you get Uptime Kuma up and running quickly. Once installed, you can leverage Uptime Kuma’s powerful features to monitor your websites, servers, and services effectively. Whether you’re managing a small personal project or a large-scale production environment, Uptime Kuma offers a customizable, self-hosted solution to keep you informed of your infrastructure’s health.
Thank you for reading the article! If you found the information useful, you can donate using the buttons below:
Donate ☕️ with PayPalDonate 💳 with Revolut