Uptime Kuma is a free and open source monitoring tool for your environment that is easy-to-use and self-hosted . Uptime Kuma is a great solution that allows the creation of simple and easy-to-use monitoring dashboards to monitor the status of servers, applications, and services in your home lab or elsewhere.
Update your Ubuntu 22.04
1
| sudo apt update && apt upgrade -y
|
Install Nodejs and NPM Using Node Version Manager
Instll the NVM Script
Install Curl:
1
| sudo apt install curl -y
|
Install the Script:
For the latest version, check out their site: Node Version Manager
1
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
|
Close and reopen your terminal or run the below-given command to source the bash file:
Now to list all versions of Node.js available with nvm, use this command:
For Uptime Kuma, they require Node.js 14 / 16 / 18 / 20.4 - I picked the lastest LTS release:
Install Uptime-Kuma
Install Git
1
| sudo apt install git -y
|
Clone Uptime Kuma Project
1
| git clone https://github.com/louislam/uptime-kuma.git
|
Switch to Uptime Kuma Directory
Run the Installation Setup Using the NPM Package Manager of Nodejs
Check to make sure you are running the latest version:
Start Uptime Kumar With Pm2
Install Pm2
1
| npm install pm2 -g && pm2 install pm2-logrotate
|
Start Server
1
| pm2 start server/server.js --name uptime-kuma
|
Create a Service File for PM2 so that it can Start Automatically
This will output something like this:
1
2
3
4
| user@uptime-kuma:~$ pm2 startup
[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/home/user/.nvm/versions/node/v18.17.1/bin /home/user/.nvm/versions/node/v18.17.1/lib/node_modules/pm2/bin/pm2 startup systemd -u user --hp /home/user
|
Copy and paste the command to have Uptime-Kuma always start when the server is restarted.
Head over to http://your_server_ip:3001 and start monitoring.
For further info: Uptime-Kuma on GitHub
How To Upgrade Uptime-Kuma
1
| cd <uptime-kuma-directory>
|
Update from Git
In order to see the latest update, go to the Uptime Kuma GitHub page: Uptime-Kuma
At the time of writing this howto, it was 1.23.1
1
2
| git fetch --all
git checkout 1.23.1 --force
|
Install Dependencies and Prebuilt
1
2
| npm install --production
npm run download-dist
|
Restart
1
| pm2 restart uptime-kuma
|