The previous articles explained how to install the uptime kuma application on Docker, either using the SQLite database or using the MariaDB database on Docker or using the MariaDB database on the host. This article will explain how to install the uptime kuma application without using Docker but using packages.
Problem
How to install uptime kuma application on Ubuntu?
Solution
Here are the steps to install uptime kuma application on Ubuntu:
1. Install the packages
Run the commands below to install the required packages:
sudo apt update -y
sudo apt install nginx mariadb-server git -y
Then, install nodejs using the command below:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt install -y nodejs
After that, download the uptime kuma application by running the command below:
git clone https://github.com/louislam/uptime-kuma.git
cd uptime-kuma/
Next, copy the commands below to install the uptime kuma application:
sudo npm run setup
sudo npm install pm2 -g
sudo pm2 install pm2-logrotate
sudo pm2 start server/server.js --name uptime-kuma
sudo pm2 startup
2. Configure MariaDB
Access MariaDB and run the queries below:
Akses ke MariaDB dan jalankan query-query di Bawah ini:
CREATE DATABASE uptime_kuma;
CREATE USER 'kuma-user'@'%' IDENTIFIED BY 'kumapass123';
GRANT ALL PRIVILEGES ON uptime_kuma.* TO 'kuma-user'@'%';
FLUSH PRIVILEGES;
\q
3. Configure web server
If you use Apache, create a file at /etc/apache2/sites-available/kuma.conf and copy the script below to the file:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/
ProxyPass / http://localhost:3001/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L]
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
then run the command below:
sudo a2enmod rewrite
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2ensite kuma.conf
Check if there is an error in Apache and if there is no error, reload Apache using the command below:
apachectl -t
sudo systemctl reload apache2
server {
listen 80;
server_name uptime-kuma.yourdomainname.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;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Added WebSocket support
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
# Improve performance of this reverse proxy
proxy_buffering off;
}
# Redirect HTTP to HTTPS if needed for encryption
# Uncomment the following lines if you have SSL enabled
# return 301 https://$host$request_uri;
}
Use the command below to check if there is an error in the nginx configuration and then reload nginx:
sudo nginx -t
sudo systemctl reload nginx
4. Access uptime kuma
Open your browser, and type:
http://ip_server:3001
then there will be a display like below:

Click MariaDB/MySQL, your screen will appear similar to the picture below:

Enter in the columns above the values that correspond to the query commands. Click the Next button, your screen will show up similar to the one below:

You have to wait until finish, and after that, your screen will appear similar to the image shown below:

Enter in the columns above the value you want and press the Create button then a display will appear similar to the image provided below:

If you want to monitor the website, click the Add New Monitor button at the top left of the site , an image similar to the one shown will appear:

Fill in the required fields (at least fill in the Monitor Type, Friendly Name, and URL columns) and press the Save button, then the host you have filled in will look like in the image below:

If you just want to display the status without displaying many attributes then you can click the Status Pages button at the top right of the site like the image below:

After you press the Status Pages button, the following image will appear:

Click the New Status Page button, and an image will appear similar to the one shown below:

Enter the name and slug you want (I wrote the sites for the name and slug), then press the Next button, then there will be a display as below:

Enter the host you want to display on the Status Page, after that click the Save button, then there will be a display as below:

You can see that the hosts to be monitored look simpler and you can give the URL to other parties to also monitor these hosts.
Note
If you want to check the status of uptime kuma in the server, run the command below :
sudo pm2 status server/server.js --name uptime-kuma

But if you want stop uptime kuma in the server, run the command below :
sudo pm2 stop server/server.js --name uptime-kuma

References
uptimekuma.org
hostmycode.in
youtube.com

