Steps to install Uptime Kuma open source monitoring solution on Ubuntu 22.04 LTS Jammy JellyFish without Docker to keep an eye on your server.
Kuma is a very lightweight monitoring tool for your own environment and many others. ICMP (ping) requests can be sent very easily or just check if a website is reachable. Even open TCP ports can be included in monitoring very easily. It is a self-hosted monitoring tool like “Uptime Robot”.
Here are its important features:
• Uptime monitoring for HTTP(s) / TCP / HTTP(s) Keyword / Ping / DNS Record / Push / Steam Game Server.
• Sophisticated, responsive and fast UI/UX.
• Notifications via Telegram, Discord, Gotify, Slack, Pushover, Email (SMTP) and 90+ notification services.
• 20 second intervals.
• Multi languages
• Multiple status pages
• Map status page to domain
• Ping graph
• Certificate Information
• Proxy support
• 2FA available
Steps to Install Kuma on Ubuntu 22.04 Linux
The commands given here to install Kuma can be used by other versions of Ubuntu servers or desktops such as 20.04 or 18.04 including Debian.
1. Update your Ubuntu 22.04
If you haven’t updated your Ubuntu 22.04 LTS Jammy for a while, run the given command first to make sure that all the packages in your system are in their latest version.
sudo apt update && sudo apt upgrade
2. Install Nodejs and NPM
The long-term stable version of Nodejs is already available to install using the APT package manager of our Ubuntu 22.04 system. However, the version we will get will be Nodejs v12 (quite old) and to install Uptime Kuma we need at least version 14. Therefore, manually add Nodejs repository to get its current version.
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
3. Install Uptime Kuma on Ubuntu 22.04
Kuma is not available to install using Ubuntu’s default system repository, so we need to clone it from the GitHub page where the project is located.
Install Git:
sudo apt install git
Clone Uptime Kuma Project
git clone https://github.com/louislam/uptime-kuma.git
Proceed to clone the Kuma directory:
cd uptime-kuma
Now run its installation configuration using Nodejs NPM package manager.
npm run setup
4. Start Uptime Kumar with Pm2
PM2 is a production process manager for Node.js applications with an integrated load balancer. The main reason for installing and using Pm2 here is that it can manage and maintain the installed Nodejs application in the background. Thus, the Nodejs command line will be free to work on other applications. It also helps to monitor the status of installed applications.
Install PM2
sudo npm install pm2 -g && pm2 install pm2-logrotate
Run Uptime Kumar server in background using PM2
start the server
pm2 start server/server.js --name uptime-kuma
After starting the server, let’s create a service file for PM2 so that it can automatically start the Kuma with our boot system.
pm2 startup
The above command checks the init system type and provides you with a command to create the pm2 service unit. Copy the script command given by the PM2 and throw it on your system. To get an idea, see the screenshot below:
5. Configure Proxy Server on Ubuntu 22.04 (Optional)
We can access the web interface of Uptime Kuma by opening the browser on our local system where we have installed it. Pointing it to Server IP address and using the port number 3001 because by default Kuma runs on this port.
http://server-ip-address:3001
Howeverif you want to use the reverse proxy server, here are the commands to do so.
For Nginx
Those who want to use Nginx can opt for the following commands:
Create an Nginx server block or virtual host file for Kuma:
sudo nano /etc/nginx/sites-available/kuma
Now add the following lines:
server {
listen 80;
server_name sub.domain.com;
location / {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
To note: If you plan to use a domain, remember to replace subdomain.com with the one you want to use.
Save the file by pressing CTRL+Othen Walk in key and finally exit the file using CTRL+X.
After activating the created configuration file, delete the default one:
sudo ln -s /etc/nginx/sites-available/kuma /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
Restart Nginx:
sudo service nginx restart
——————————————————————————————
For Apache
Install Apache web server
sudo apt install apache2
Activate a few required modules:
sudo a2enmod ssl proxy proxy_ajp proxy_wstunnel proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html
Restart apache:
sudo systemctl restart apache2
Create a virtual host configuration file for Kuma:
sudo nano /etc/apache2/sites-available/kuma.conf
Paste the following lines:
<VirtualHost *:80>
ServerName sub.domain.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>
To note: If you plan to use a domain, remember to replace subdomain.com with the one you want to use.
Disable the default Apache configuration:
sudo a2dissite 000-default.conf
Activate the one you created for Kuma:
sudo a2ensite kuma.conf
Reload Apache
sudo systemctl reload apache2
To have other web servers configured as reverse proxy serverusers can see the GithubGenericName dedicated to this.
6. Availability Kumar web interface
After using Nginx or Apache as a proxy server, you can access the Kuma web interface to configure it.
7. Let’s Encrypt SSL certificate
Those not using a third-party SSL provider or DNS manager such as Cloudflare can directly generate the SSL certificate for free using the Let’s encrypt for domain used for Uptime Kuma running on Ubuntu 22.04. Here is the command to follow:
sudo apt install certbot
For Nginx:
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d yourdomain.com
For Apache:
sudo apt install python3-certbot-apache
sudo certbot --apache -d yourdomain.com
To note: Replace yourdomain.com with the one you have.
Other Items:
Install Google Cloud SQL Proxy on Ubuntu 22.04 | 20.04
3 Ways to Install Nodejs & NPM on Ubuntu 22.04 LTS Jammy
How to Install Checkmk on Ubuntu 22.04 LTS Jammy…
How to Install MediaWiki on Ubuntu 22.04
How to Install ownCloud on Ubuntu 22.04