How to Install Uptime Kuma on OpenBSD
Uptime Kuma is an open-source self-hosted monitoring tool that provides a dashboard to track the status of web sites and applications. In this tutorial, we will guide you through the steps necessary to install Uptime Kuma on OpenBSD.
Requirements
Before starting, ensure that you have the following prerequisites:
- Access to an OpenBSD server
- A non-root user account with sudo privileges
- A web server installed on your server, such as Apache or Nginx
- Git installed on your server
Step 1: Install Node.js and Yarn
Uptime Kuma requires Node.js to run. To install Node.js, follow these steps:
Update the package manager first by running the following command:
$ doas pkg_add -uInstall the
nodeandyarnpackages by running the following command:$ doas pkg_add yarn node
Step 2: Install Uptime Kuma
Clone Uptime Kuma's repository from GitHub using the
gitcommand:$ git clone https://github.com/louislam/uptime-kuma.gitChange into the newly cloned directory:
$ cd uptime-kumaInstall the necessary packages using
yarn:$ yarn
Step 3: Configure Uptime Kuma
Copy the
config.sample.jsonfile toconfig.jsonusing the following command:$ cp config.sample.json config.jsonEdit the
config.jsonfile using your favorite editor, and set the following properties:"baseUrl": "http://<your_domain_name_or_IP_address>", "dbPath": "<full_path_to_uptime_kuma_folder>/uptime-kuma/var/data.db",
Step 4: Set up Web Server
Note: This guide assumes that you are using Nginx as your web server.
Create the Nginx server block:
server { listen 80; server_name <your_domain_name_or_IP_address>; location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 300s; proxy_connect_timeout 75s; proxy_send_timeout 300s; } }Save this block in
/etc/nginx/sites-available/uptime-kumafile.Create a symlink to enable this server block:
$ cd /etc/nginx/sites-enabled/ $ ln -s ../sites-available/uptime-kuma .Restart Nginx to enable these changes:
$ doas /etc/rc.d/nginx restart
Step 5: Start Uptime Kuma
Start Uptime Kuma using the following command:
$ yarn startThis will launch the Uptime Kuma dashboard and keep it running in the foreground. To run it in the background, run the following command instead:
$ yarn start --silent &You should now be able to access Uptime Kuma by visiting
http://<your_domain_name_or_IP_address>in your web browser.
Congratulations! You have successfully installed Uptime Kuma on OpenBSD.