frank
Goto Top

Install Monitoring Uptime Kuma

article-picture
I have been looking for a simple monitoring program for our website for some time. Thanks to the help of our users I found in a post the monitoring software Uptime Kuma.

Uptime Kuma is a web server that uses different types of monitors ( HTTP(s), TCP ports, keywords, ping, DNS, push, etc.) to store and check the status of the hardware or software being monitored and, if necessary, alert you via notifications of various types (Telegram, Discord, Signal, Slack, Pushover, Email (SMTP), etc.). The software is easy to use and can additionally create its own status overviews. You can install it via Docker or directly. Here are my instructions for the installation without Docker.


back-to-topRequirements


  • Ubuntu Linux 22.04.1 LTS on a machine or VM that is always running (you want continuous monitoring).
  • The installation should be run as a standalone user and not as root user. In my example it is always the user 'frank'.
  • node, npm, nvm, pm2
  • git

back-to-topInstallation: Version Manager (nvm), Node (node) and Node Package Manager (npm)


If you already have Node and npm installed on your system, you can skip this step.

Node and npm should be installed with a version manager (nvm). This way you can keep an overview of the many versions. See also: https://github.com/nvm-sh/nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

The terminal must be restarted for the environment variables to work. After that the command "nvm" should be available. Short check:

frank@doom:~# nvm --version
0.39.2

Now we install the current version of Node:

nvm install node

After the automatic download and install we check it with:

frank@doom:~# node -v
v19.3.0
frank@doom:~# npm -v
9.2.0

Now all requirements are met (nvm, npm and node).

back-to-topInstallation: Uptime Kuma


Details, source code and configuration can be found at: https://github.com/louislam/uptime-kuma

Now we check again for the current npm version and install the latest version if necessary:

npm install npm -g

Then we load the source code from Git and start the installation:

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

When the message "Done" appears, it still takes a few minutes until the input appears again. Do not abort before!

The "Uptime Kuma" server is ready to start. You can start it directly with the following command:

node server/server.js

back-to-topInstallation: Process Manager (pm2)


I personally find it better if the server runs and is managed in the background. For this we install a process manager (pm2):

npm install pm2 -g && pm2 install pm2-logrotate

Now we start the "Uptime Kuma" server using pm2:

The default settings for this are: "localhost" and port "3001":

pm2 start server/server.js --name uptime-kuma

You can of course customize the port and the host:
pm2 start server/server.js --name uptime-kuma -- --port=80 --host=0.0.0.0

After the start it should now look like this:

b9bec4e125e4ebcf59d1d363845528a0

The installation is finished. You can reach the Uptime Kuma Admin web page at:

http://localhost:3001

With the process manager pm2 you can control the server:

pm2 start uptime-kuma
pm2 stop uptime-kuma
pm2 restart uptime-kuma

back-to-topStart automatically at boot time


To make Uptime Kuma start automatically on the next reboot, enter the following command:

pm2 save && pm2 startup

Now a generated command appears. Now paste this command completely into the shell via Copy&Paste and execute it:

sudo env PATH=$PATH:/home/frank/.nvm/versions/node/v19.3.0/bin /home/frank/.nvm/versions/node/v19.3.0/lib/node_modules/pm2/bin/pm2 startup systemd -u frank --hp /home/frank

This will start the server at the next reboot.

Tip: To get rid of the autostart of the server enter the following:

pm2 unstartup systemd

back-to-topUbuntu Firewall (ufw)


If the Ubuntu firewall is active, you have to release port 3001:

ufw allow 3001

back-to-topCall GUI


http://localhost:3001

At the first start the GUI asks for the language and creates a new user:

699563d5baa6d87477392b7a90763be5

After that you start in the Dashboard. Here you can create a new monitor:

239ae2fed2cbc035638ad7930b96a32c

66a2e5ed63b5a3bf5ebf791f184e8f43

c434462e158926058f62039ed1c30f89

That's it face-smile

Feedback, questions and additions are welcome. If you like the tutorial, I am happy about every Like (click on the heart).

Greeting
Frank

Content-ID: 5509572276

Url: https://administrator.de/contentid/5509572276

Ausgedruckt am: 23.11.2024 um 09:11 Uhr

JonasG
JonasG 06.04.2023 um 17:46:36 Uhr
Goto Top
Thank you! The trainees of our Responsive Web Design Agency would like to thank you face-smile