|

Monitor Uptime

Uptime Kuma is a self-hosted monitoring tool that you can use to monitor websites and applications in real time.

https://github.com/louislam/uptime-kuma

Uptime Kuma Features

  • Monitors uptime for HTTP(s) websites, TCP Ports, and Docker containers and retrieves information such as DNS records.
  • Sends notifications via Email (SMTP), Telegram, Discord, Microsoft Teams, Slack, Promo SMS, Gotify, and 90+ notification services.
  • Supports multiple languages.
  • Provides multiple Status Pages.
  • Provides Proxy Support.
  • Displays SSL certificate information.
  • Maps Status Page to Domain.

Install Uptime Kuma self-hosted monitoring tool and monitor websites using the tool. Works on Ubuntu 20.04 and RHEL.

Step 1: Installing Node.JS in Linux

$ sudo apt update
$ sudo dnf update

add the Nodesource repository to your system.

$ curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -   [On Debian systems]
$ curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -   [On RHEL systems]

install Node.JS using the package manager 

$ sudo apt install nodejs -y   [On Debian systems]
$ sudo dnf install nodejs -y   [On RHEL systems]

confirm the version of NodeJS 

$ node --version

V16.17.0

Step 2: Installing Uptime Kuma in Linux
Install the Uptime Kuma monitoring tool. First, clone the Uptime Kuma repository from GitHub.

# git clone https://github.com/louislam/uptime-kuma.git
# cd uptime-kuma/
# npm run setup

Step 3: Run Uptime Kuma with pm2
PM2 is a production process manager for NodeJS applications that provide a load balancer and helps keeps applications alive indefinitely and reload them without any interruption or service downtime. To install the PM2 daemon, run the following command while still in the uptime-kuma directory.

# npm install pm2@latest -g
# pm2 start npm --name uptime-kuma -- run start-server -- --port=3001 --hostname=127.0.0.1
# pm2 logs
# pm2 startup
# pm2 save

Step 4: Configure Apache as a Reverse Proxy for Uptime-Kuma
Install the Apache web server and configure it to serve as a reverse proxy for Uptime Kuma.

$ sudo apt install apache2 -y   [On Debian systems]
$ sudo dnf install httpd -y     [On RHEL systems]

Enable the following modules which will be required by the monitoring tool on Debian-based systems.

# a2enmod ssl proxy proxy_ajp proxy_wstunnel proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html

Create a virtual host file for Uptime Kuma.

$ sudo nano /etc/apache2/sites-available/uptime-kuma.conf   [On Debian systems]
$ sudo vi /etc/httpd/conf.d/uptime-kuma.conf                [On RHEL systems]

Paste the following lines of code. For the ServerName directive, specify your server’s Fully Qualified Doman Name or public IP address.

<VirtualHost *:80>
  ServerName kuma.example.com

  ProxyPass / http://localhost:3001/
  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} websocket [NC]
  RewriteCond %{HTTP:Connection} upgrade [NC]
  RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L]
</VirtualHost>

Activate the Apache virtual host for Uptime Kuma as shown on Debian-based systems.

$ sudo a2ensite uptime-kuma
$ sudo systemctl restart apache2   [On Debian systems]
$ sudo systemctl restart httpd     [On RHEL systems]

Step 5: Access Uptime Kuma from the WebUI

With Uptime Kuma installed and fully configured, launch your browser and visit your server’s domain name or public IP address.

http://server-ip
OR
http://domain-name

The WebUI will appear as shown and you will be required to create an Admin account. Therefore, provide the username and password and click ‘Create’ to create an Administrator account.

Uptime Kuma Admin Account
Uptime Kuma Admin Account

This will log you into Uptime Kuma’s dashboard. To start monitoring a website, click the ‘Add New Monitor’ button. Fill out the details of the site that you want to monitor.

Add Website to Monitoring
Add Website to Monitoring

Shortly after, Uptime Kuma will start monitoring your site and provide various uptime metrics as shown.

Monitoring Website in Uptime Kuma
Monitoring Website in Uptime Kuma

Similar Posts