Skip to main content

Shenzhen, China

Provision Uptime Kuma with Docker

Prepare a volume mount:

sudo mkdir /opt/uptime
sudo chown $(whoami):$(whoami) /opt/uptime
sudo chmod 777 /opt/uptime

Download the latest Docker image from Docker Hub:

docker pull louislam/uptime-kuma:1-alpine

Run the container in Docker:

docker run -d --restart=unless-stopped --net=host \
  # -p 3001:3001 \
  -v /opt/uptime:/app/data \
  --name monitor \
  louislam/uptime-kuma:1-alpine

Or with docker-compose up -d:

version: '3'
services:
  app:
    image: louislam/uptime-kuma:1-alpine
    container_name: monitor
    restart: unless-stopped
    network_mode: host
    # ports:
    #   - 3001:3001
    volumes:
      - /opt/uptime:/app/data

Visit the webUI on localhost:3001 and create an admin user and activate dark mode:

Uptime Kuma

Uptime Kuma

Monitoring your INSTAR Camera

MQTT Heartbeat

Start by clicking on Add New Monitor:

Uptime Kuma

Select MQTT as Monitor Type and add the MQTT broker configuration from your INSTAR camera:

Uptime Kuma

The Hostname is the local IP (or DDNS address) of your camera and Port is the regular MQTT server port that defaults to 1883:

Uptime Kuma

You can use the Last-Will-and-Testament (lwt-topic) to monitor your camera - default mqtt prefix/camera id/status/connection:

Uptime Kuma

Add the topic to your monitor:

Uptime Kuma

Note: Use the "online" payload without any spaces or it will not match: {"val":"online"}:

Uptime Kuma

Once corrected the camera will show up as online:

Uptime Kuma

Uptime Kuma

HTTP Heartbeat

For older INSTAR IP cameras that don't support the MQTT protocol we can use an HTTP endpoint (random CGI command) and sending GET requests to verify that the camera is connected and running. Start by clicking on Add New Monitor:

Uptime Kuma

This time select HTTP as Monitor Type and add the IP address with a random CGI command as URL (e.g. getsysinfo):

Uptime Kuma

As authentication choose HTTP Basic Auth and add your camera login:

Uptime Kuma

The monitor will now contact your camera once a minute to verify that it is still running:

Uptime Kuma

Adding Notifications

Now to the interesting part - how do I receive notifications about events on my network on my Android phone?

There are quite a few options to choose from. Let's take a look at a simple, self-hosted solution called ntfy.

Start by selecting one of your monitors and click on Setup Notification:

Uptime Kuma

And add the topic and URL of your nfty installation:

Uptime Kuma

Click to test your configuration:

Uptime Kuma

And you should see the test update on the nfty dashboard:

Uptime Kuma