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: null
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 - https://www.patreon.com/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-kuma.git
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/$releasever/$basearch/
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:password@postgresql.lazy.test: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:password@mysql.lazy.test: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!!!
0 Comments