How to Install Uptime Kuma on NixOS Latest
Uptime Kuma is an open source self-hosted monitoring tool that helps you track your website uptime, API responsiveness, server response time, etc. In this tutorial, we'll show you how to install Uptime Kuma on NixOS 21.05.
Prerequisites
Before we begin, make sure you have the following:
- Access to a NixOS server or VPS with root privileges
- A basic understanding of the Nix package manager and Nix expressions
- A domain name or subdomain pointed to your server's IP address (optional)
Step 1: Install Dependencies
Uptime Kuma requires Node.js (v12 or greater) and SQLite. To install these dependencies on NixOS, add the following lines to /etc/nixos/configuration.nix:
environment.systemPackages = with pkgs; [
nodejs
sqlite
sqlite3
];
Save the file and run nixos-rebuild switch to apply the changes.
Step 2: Clone Uptime Kuma
Next, clone the Uptime Kuma repository to your server:
git clone https://github.com/louislam/uptime-kuma.git
This will create a directory called uptime-kuma in your current directory.
Step 3: Configure Uptime Kuma
Navigate to the uptime-kuma directory and create a new file called .env:
cd uptime-kuma
touch .env
Open the .env file in your favorite text editor and add the following configuration:
DB_TYPE=sqlite
DB_HOST=127.0.0.1
DB_PORT=27017
DB_NAME=uptime
Save and close the file.
Step 4: Install Dependencies for Uptime Kuma
Run the following command to install the required Node.js modules:
npm install
Step 5: Start Uptime Kuma
Finally, start Uptime Kuma with the following command:
npm start
This will start the Uptime Kuma server on port 3000. You can access the web interface by visiting http://your_server_ip:3000 in your web browser. If you have a domain name or subdomain pointed to your server's IP address, you can access the web interface using that instead.
Conclusion
In this tutorial, we showed you how to install Uptime Kuma on NixOS 21.05. With Uptime Kuma up and running, you can monitor your website uptime and performance with ease.