Setting up Uptime Kuma on Kapsi.fi
Small tutorial on how to run Uptime Kuma on Kapsi.fi shared hosting environment without Docker.
Prerequisities:
- Kapsi account
- Port opened to webapp servers. Request this from Kapsi admins.
- ssh
- (Optional) Own domain address
Steps:
- Ssh to the webapp-bullseye server
ssh <account>@webapp-bullseye.kapsi.fi - Install
nvmto install Nodejs. See the recent installation guide from here.
I just used the wget snippet and then added below to.bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
After this run nvm install which at the writing install NodeJS v23.
You can also run nvm install --lts to install latest LTS version.
Change directory to desired domain you want to install eg
cd /sites/domain.com/www/Create a
.htaccessfile with following content.
This redirects requests fromdomain.comto the underlying web server running inwebapp-bullseye.n.kapsi.fi:<PORT>
# Uudelleenohjaus http -> https
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteCond %{REQUEST_URI} ^/(.*)$
RewriteRule ^(.*) ws://webapp-bullseye.n.kapsi.fi:<PORT>/$1 [P]
RewriteRule ^(.*)$ http://webapp-bullseye.n.kapsi.fi:<PORT>/$1 [P]
- Follow the official instructions for non-Docker installation here.
git clone https://github.com/louislam/uptime-kuma.git .- Create
.envfile to the root installation with this content
UPTIME_KUMA_HOST= webapp-bullseye.n.kapsi.fi
UPTIME_KUMA_PORT=<PORT>"
- Do a test run with
node server/server.js, and access your domain egdomain.com
- Install
pm2for running as a background processes
npm install pm2 -g && pm2 install pm2-logrotate- Start it
pm2 start server/server.js --name uptime-kuma
- Create cronjob entry for starting the server on reboot
crontab -e- Add following
@reboot cd ~/sites/domain.com/www && pm2 start server/server.js --name uptime-kuma