Website Monitoring Using Uptime Kuma
I've set up this site, the platform to count visitor, and Nginx Proxy Manager to handle reverse proxies and ssl. Now I want to be kept up to date if something goes wrong. Thats why I've also set up Uptime Kuma.
It's a simple tool that checks the availability of web services. The application runs as a container and is configured through the simple, intuitive web interface.
Uptime Kuma
Like always, I will be using docker-compose. Like last times, create a folder with two files inside: docker-compose.yml
and .env
.
The first part of the compose file will look the same as with the other docker-compose.yml
files:
version: "3"
networks:
default:
external:
name: npm_network
We again define the syntax version we will be using.Next we set the default network to be the same external one NPM is connected to. This allows NPM to reverse proxy to this service without exposing the ports to our host.
Next we define the service:
services:
uptime-app:
image: louislam/uptime-kuma:latest
volumes:
- ${DATADIR}/app:/app/data
restart: unless-stopped
This is the shortest service so far. We only need one service, as Uptime Kuma doesn't need an external database. We specify the directory where all persistent data will be saved. To finish it, we tell docker-compose to restart the service, unless we stopped it.
All that's left to do for us now is to run docker-compose up -d
to launch it in the background.
Reverse Proxy
Next we need to create a new reverse proxy in NPM that will point to http://uptime-app:3001
. More info about setting up NPM you can find in this post, more info on creating a reverse proxy is available in this one.
First Monitor
Now that everything is running we can go to the web interface of Uptime Kuma. Surf to the URL you just defined in the previous step. Create an admin account and click Add New Monitor
and fill in the details. Now you can see the monitor is running.
We shall add this monitor to the status page so other people can see if it's up. Go to Status Page
in the top right corner, click Edit Status Page
, select the monitor you want to add and click Save
.
Notifications
Uptime Kuma has the option to send you notifications when a service goes down. It supports a lot of notification types. I use Gotify hosted on my own server. How I've set this up will be for another posts.