Install Uptime Kuma Inside Docker Container in Linux

Install Uptime Kuma Inside Docker Container in Linux

Uptime Kuma is an open-source tool to monitor the uptime of hosts or servers. This tool can be used to check if a website or service is up. If the monitored target is not reachable for a specified time interval, then notifications can be sent via Slack, Telegram, Discord, or other notification service. Uptime Kuma provides a dashboard that can be accessed via a web browser.

This tutorial explains how to install Uptime Kuma inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install Uptime Kuma

  • Host network

Run the following command to create a container for Uptime Kuma that uses host network:

docker run -d --name=uptime-kuma --restart=always --network=host \
    -v /opt/uptime-kuma/data:/app/data \
    louislam/uptime-kuma
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, Uptime Kuma service is listening on port 3001. It can be changed with -p option.

docker network create app-net
docker run -d --name=uptime-kuma --restart=always --network=app-net \
    -p 8080:3001 \
    -v /opt/uptime-kuma/data:/app/data \
    louislam/uptime-kuma

Testing Uptime Kuma

Open a web browser and go to http://<IP_ADDRESS>:3001, where <IP_ADDRESS> is the IP address of the system. For the first time, you will be asked to create the administrator account. After that, you will be redirected to the dashboard.

Uptime Kuma Inside Docker Container in Linux

Uninstall Uptime Kuma

To completely remove Uptime Kuma, remove its container:

docker rm --force uptime-kuma

Remove Uptime Kuma image:

docker rmi louislam/uptime-kuma

You can also remove Uptime Kuma data:

sudo rm -rf /opt/uptime-kuma

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.