Install Uptime Kuma Similar to "Uptime Robot" - Monitor Website PostreSQL MySQL with Uptime Kuma

Published: 23 March 2023
on channel: The Lazy SysAdmin
4,645
38

In this video, you will learn the steps to install and configure Uptime Kuma, a web-based service monitoring tool. I will also show you how to set up a reverse proxy with Nginx and secure it with SSL.

Join this channel to get access to perks: https://www.youtube.com/@lazysysad/join

Furthermore, I will demonstrate how to set up monitoring for a website and a server. I'll also demonstrate database monitoring for MySQL and PostgreSQL.

PLEASE SUBSCRIBE :)
PLEASE HIT LIKE IF IT HELPED :)

GIVE SUPPORT -   / lazysysad  
BUY ME A COFFEE - https://www.buymeacoffee.com/lazysysad
PAYPAL - https://paypal.me/lazysysad

LINKS:
Uptime Kuma - https://github.com/louislam/uptime-kuma

Steps:
Installation
Install Npm and Git.
dnf -y install npm git

Update npm
npm install npm -g

Clone the Uptime Kuma repository
cd /opt/
git clone https://github.com/louislam/uptime-ku...
cd uptime-kuma

Rrun the setup command
npm run setup

Install PM2
npm install pm2 -g && pm2 install pm2-logrotate

Start the Uptime Kuma.
pm2 start server/server.js --name uptime-kuma

To ensure the server runs automatically after a reboot
pm2 save && pm2 startup

Reverse Proxy
Install Nginx
Create a new repository
vi /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/rhel/$rele...
gpgcheck=0
enabled=1

Remove any existing Nginx packages and install the latest version:
dnf -y remove nginx*
dnf -y install nginx

Backup config file:
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.orig

Create new config file:
vi /etc/nginx/conf.d/default.conf

server {
listen 443 ssl http2;
Remove '#' in the next line to enable IPv6
listen [::]:443 ssl http2;
server_name uptime-kuma.lazy.test;
ssl_certificate /etc/nginx/ssl/localhost.crt;
ssl_certificate_key /etc/nginx/ssl/localhost.key;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://localhost:3001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

Create SSL:
mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
vi ssl-info.txt

[req]
default_bits = 2048
prompt = no
default_keyfile = localhost.key
distinguished_name = dn
req_extensions = req_ext
x509_extensions = v3_ca

[ dn ]
C = PH
ST = NCR
L = Manila
O = localhost
OU = Development
CN = localhost

[req_ext]
subjectAltName = @alt_names

[v3_ca]
subjectAltName = @alt_names

[alt_names]
DNS.1 = uptime-kuma.lazy.test
DNS.2 = localhost
DNS.3 = 127.0.0.1

Generate a self-signed SSL/TLS certificate:
openssl req -x509 -nodes -days 3652 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -config ssl-info.txt

Start Nginx:
systemctl enable --now nginx

Firewall
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Add New Monitor
HTTP(s)
Monitor Type: HTTP(s)
Friendly Name: Uptime Kuma WebUI
URL: https://uptime-kuma.lazy.test/
Certificate Expiry Notification: enabled
Ignore TLS/SSL error for HTTPS websites: enabled
Description: Uptime Kuma Dashboard

Ping
Friendly Name: Uptime Kuma Server
Hostname: uptime-kuma.lazy.test
Description: Uptime Kuma Server

PostgreSQL
sudo -u postgres psql
CREATE USER uptime_kuma WITH PASSWORD 'password';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO uptime_kuma;
\q

vi /var/lib/pgsql/15/data/pg_hba.conf
host all uptime_kuma 192.168.100.81/32 md5

systemctl reload postgresql-15

Monitor Type: PostgreSQL
Friendly Name: PostgreSQL
Connection String: postgres://uptime_kuma:[email protected]:5432/postgres
Query: SELECT * FROM pg_stat_database;
Description: PostgreSQL

MySQL
CREATE USER 'uptime_kuma'@'192.168.100.81' IDENTIFIED BY 'password';
GRANT SELECT ON mysql.* TO 'uptime_kuma'@'192.168.100.81';
FLUSH PRIVILEGES;

Monitor Type: MySQL/MariaDB
Friendly Name: MySQL
Connection String: mysql://uptime_kuma:[email protected]:3306/mysql
Query: SELECT 1;
Description: MySQL

Chapters:
00:00 Uptime Kuma Installation
00:53 Nginx Installation
01:26 Reverse Proxy Configuration
01:55 Generate SSL Certificate
03:03 Firewall Setup
03:23 Access Uptime Kuma Dashboard
03:54 Monitor a Website
04:26 Monitor a Server
04:55 Monitor a PostgreSQL Server
06:08 Monitor a MySQL Server
06:57 Create Status Page

Drop me your feedback and comments below.

That's all for now.

If this video helped you in any way, please like share and subscribe!

Thank you!!!


Watch video Install Uptime Kuma Similar to "Uptime Robot" - Monitor Website PostreSQL MySQL with Uptime Kuma online without registration, duration hours minute second in high quality. This video was added by user The Lazy SysAdmin 23 March 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,645 once and liked it 38 people.