How to Install Uptime Kuma on FreeBSD Latest
Uptime Kuma is a modern replacement for the once-popular Uptime Robot service. It is an open-source solution that can be installed on your own server, offering more control over its functionality and data privacy. In this tutorial, we will show you how to install Uptime Kuma on FreeBSD Latest.
Prerequisites
To follow this guide, you will need:
- A FreeBSD Latest server
- Root access to the server
- An existing web server like Apache or Nginx
- Basic knowledge of command-line interface
Steps to Follow
Update FreeBSD Latest using the following command:
sudo pkg update && sudo pkg upgradeInstall the necessary dependencies using the following command:
sudo pkg install node yarn sqlite3Create a new directory where you want to host Uptime Kuma using the following command:
sudo mkdir -p /var/www/uptime-kumaClone Uptime Kuma's source code from Github in the /var/www/uptime-kuma directory using the following command:
sudo git clone https://github.com/louislam/uptime-kuma.git /var/www/uptime-kumaGo to the cloned directory using the following command:
cd /var/www/uptime-kumaInstall the required packages using Yarn by running the following command:
sudo yarn install --production --ignore-enginesCreate a new configuration file by copying the sample config file using the following command:
sudo cp .env.sample .envOpen the configuration file using your favorite text editor and modify the following variables:
APP_URL=http://localhost:5000 DB_CONNECTION=sqliteSave and close the file.
Create a new database using the following command:
sudo touch database/uptime-kuma.sqliteSet permissions for the database file using the following command:
sudo chown -R www:www database/uptime-kuma.sqlite
- Start the Uptime Kuma server using this command:
sudo yarn start
- Open your web browser and navigate to http://IP_ADDRESS:5000 to access Uptime Kuma.
Note: Replace "IP_ADDRESS" with the actual IP address of your server.
- Create an Nginx configuration file for Uptime Kuma using the following command:
sudo touch /usr/local/etc/nginx/sites-available/uptime-kuma
- Open the Nginx configuration file using your favorite text editor and add the following content:
server {
listen 80;
server_name domain.tld;
root /var/www/uptime-kuma/public;
location / {
try_files $uri /index.html;
}
location /api {
proxy_pass http://localhost:5000;
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;
}
}
Save and close the file.
- Create a symbolic link from the sites-available directory to the sites-enabled directory using the following command:
sudo ln -s /usr/local/etc/nginx/sites-available/uptime-kuma /usr/local/etc/nginx/sites-enabled/uptime-kuma
- Restart the Nginx service using the following command:
sudo service nginx restart
- You can now access Uptime Kuma on your web browser by navigating to http://domain.tld.
Congratulations! You have successfully installed Uptime Kuma on FreeBSD Latest.