Build Your Homelab: 27 – Uptime Kuma

Homelab 27 - Uptime Kuma

If you have been following along with our Build your own homelab series, you will have quite a few services and apps already running, from a simple Minecraft server to a Microsoft SQL Server 2022 Database Container. Even if you are running your own Proxmox server (or any other hypervisor or NAS OS), we all need a way to ensure that our services are up and running. We also need to way to alert us should they fail, shutdown or crash. Today we are going to look a fantastic tool to monitor our servers, services and apps. Let’s get Uptime Kuma installed and set up.


Step 1: Install choice

The easiest way to get Uptime Kuma installed will again be with the help of the awesome helper-scripts.com. We are not going to focus on that (easy) install, but if you want to use helper-scripts and get it up and running as a seperate LXC Container, feel free to go through the normal steps from the site: https://community-scripts.github.io/ProxmoxVE/scripts?id=uptimekuma

In stead of installing Uptime Kuma as a separate LXC container, we are going to run it in our previously set up Docker LXC Container, with the help of the installed Portainer instance already running in our Docker LXC Container. For this to work, we will need to find out what the Docker command is for Uptime Kuma. Luckily this is super easy seeing as we can just visit the official Uptime Kuma website: https://uptime.kuma.pet/

Uptime Kuma Website

The Uptime Kuma Website (https://uptime.kuma.pet/) contains the Docker Install Command

Here we can get the install command for Docker:

docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1

Command Breakdown

  • docker run: This tells Docker to create and start a new container.
  • -d: Run the container in detached mode (in the background).
  • --restart=always: Automatically restart the container if it stops, crashes, or if the host system reboots. Great for ensuring uptime (…for Uptime Kuma 🙂 ).
  • -p 3001:3001: Map port 3001 on your host to port 3001 inside the container. This is how you’ll access Uptime Kuma in your browser via http://localhost:3001.
  • -v uptime-kuma:/app/data: Mount a Docker volume called uptime-kuma to the container’s internal path /app/data. This ensures that your data (like monitored services and settings) is persisted across container restarts or rebuilds.
  • --name uptime-kuma: Assign a name to the container so you can reference it easily later with docker stop uptime-kuma or docker logs uptime-kuma.
  • louislam/uptime-kuma:1: This is the image to use. Specifically, it uses the louislam/uptime-kuma image, and :1 refers to version/tag 1. If you omit the version, Docker will default to :latest. Normally you would want to use the latest version, but the website states we need to use version/tag 1, so we will do that.

Step 2: Install with the help of Portainer

We have our Docker LXC running on our Local LAN IP 192.168.1.35, so we can access Portainer by going to https://192.168.1.35:9443. We then need to log in with the admin user and the password we set up when installing Portainer. We should see all of the connected Environments, in our case just the one environment: the local environment. This is also the environment running Portainer, hence we will have 1 Volume and 1 Image running. These are the Portainer volume and image, so this is correct.

First things first, we need to get the image, so we can run a new container. Access the Docker Environment you want to use to install Uptime Kuma, in our case local. The left navigation menu will have a few new items. Go to Images, and add the following in the Image field of the main window:

louislam/uptime-kuma:1

Click the Portainer Pull Image Button button to download the image with all its dependencies. It will be ready to create a new container.

Before continuing, we also need to create a new volume for our container, so in the left navigation menu, click on Volumes and then on Portainer Add Volume Button in the main window. We need to create a volume with the following settings:

Name– Let’s stick with the name from the Docker command, and make it uptime-kuma.
Access control – Let’s remove access control for now as we don’t need it.
The rest of the settings can be left as default

We are now ready to create a new container for Uptime Kuma. To create a new container, select Containers in the left navigation window. We need to create a new Container, so in the main window, click the Portainer Add Container button. We can now fill in the details of the new container, using the Docker Command as reference:

Name – can be anything, but we are sticking to uptime-kuma as per the Docker command
Image – This is going to be louislam/uptime-kuma:1 again, the image we just downloaded.
Port Mapping – We need to expose the port, so we need to click Portainer Map Additional Port Button button and add one port. Both the Host and Container fields needs to be 3001.
Access Control – For now we don’t want to restrict access, so we are going to disable access control
Advanced Container Settings – Before deploying the container, we need to change some advanced settings, so we need to go to the following tabs under Advanced Container Settings:
Volumes– Click Portainer Map Additional Volume Button to add a new volume. The Container path should be /app/data and the volume should be selected as the created uptime-kuma we created.
Restart Policy – Change the Restart policy to always as per the Docker Command
Portainer Restart Policy

With all the details filled in, we can go ahead and click Portainer Deploy the Container Button to deploy the new container. Give it a second or two for it to come online.

Once online, we can access Uptime Kuma by going to the Docker LXC Container IP Address, on port 3001 (the port we exposed). In our case that would be:

http://192.168.1.35:3001

Note that it should be http, not https. Yes, we can add a reserve proxy in our nginx VM, but for now we are happy to access Uptime Kuma from our local network only (we can also connect to our VPN if we are not home.


Conclusion

This was our first service that we installed in our Build your own Homelab series that did not require us to log in to our Proxmox instance to install a new LXC or to access the console of an existing LXC Container or VM. This goes to show how one service, in this case Portainer, can make our lives easy in terms of new service deployments or managing of existing services. We still need to configure Uptime Kuma and also set up notifications, where we will use our installed ntfy instance, so stay tuned for the next instalment in our series.