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:

  1. Ssh to the webapp-bullseye server ssh <account>@webapp-bullseye.kapsi.fi
  2. Install nvm to 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.

  1. Change directory to desired domain you want to install eg cd /sites/domain.com/www/

  2. Create a .htaccess file with following content.
    This redirects requests from domain.com to the underlying web server running in webapp-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]
  1. Follow the official instructions for non-Docker installation here.
  • git clone https://github.com/louislam/uptime-kuma.git .
  • Create .env file 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 eg domain.com
  1. Install pm2 for running as a background processes
  • npm install pm2 -g && pm2 install pm2-logrotate
  • Start it pm2 start server/server.js --name uptime-kuma
  1. 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