Log in to the Ubuntu instance and launch a terminal window.
In our example, this will put us in the /home/UbuntuUser folder.
Verify your folder ID by typing pwd at the terminal command promt
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install nodejs -y
sudo node -v to check the nodejs installed version
sudo apt-get install git -y
sudo git clone https://github.com/louislam/uptime-kuma.git
You can verify the git clone process by typing ls -l at the prompt which should now show an uptime-kuma folder
sudo apt-get install npm --no-install-recommends
at the /home/InsertUserIDHere prompt type: cd uptime-kuma
sudo npm run setup
*this will install uptime-kuma
sudo npm install pm2 -g
**PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime, and to facilitate common system admin tasks.
sudo pm2 install pm2-logrotate
*You should see output similar to the image below:
cd uptime-kuma
*type pwd to verify location is /home/InsertUserIDHere/uptime-kuma
sudo pm2 start server/server.js --name uptime-kuma
*You should see output similar to the image below:
sudo pm2 status
Now, type:
sudo pm2 startup
sudo pm2 save
cd /etc/systemd/system
sudo nano pm2-root.service
find the line labeled Environment=PATH=....
go to the end of the line
add the following: :/home/InsertUserIDHere/uptime-kuma/server
*note: be sure to include the : and do not put a space after the end of the previous entry on the line
Ctrl+O to write file edits to disk. Ctrl+X to exit nano editor
Now, we'll install the Nginx web server:
sudo apt-get install nginx -y
sudo nano /etc/nginx/conf.d/kuma.conf
Add the following lines:
server {
listen 80;
servername kuma.example.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;
}
}
Ctrl+O to write file to disk. Ctrl+X to exit nano editor.
Now, copy the kuma.conf file to /etc/nginx/sites-available folder by typing:
sudo cp /etc/nginx/conf.d/kuma.conf /etc/nginx/sites-available/kuma
*note: leave the .conf off of the target filename
Now, create a symbolic link in the /etc/nginx/sites-enabled folder to the kuma file in the /etc/nginx/sites-available folder
sudo ln -s /etc/nginx/sites-available/kuma /etc/sites-enabled/kuma
Verify the link by:
cd /etc/nginx/sites-enabled
sudo ls -la
There should be a kuma symbolic link file in the /etc/nginx/sites-enabled folder
Remove the Nginx default website link
cd /etc/nginx/sites-enabled
sudo rm /etc/nginx/sites-enabled/default
sudo ls -la
Reboot the host:
sudo reboot
Now, you should be able to navigate within the Kuma host linux system using a browser to:
http://localhost:3001
This will bring up the initial setup Kuma administrator login screen.
**NOTE: Be careful in choosing your admin USERID here as there is not a simple process for changing this ID once it is created and written into the SQLlite database.