How to install Gatus on nixOS Latest
Gatus is a lightweight and easy to use automated service health dashboard that can be used to monitor the status of your microservices, APIs, and websites. In this tutorial, we will guide you on how to install Gatus on nixOS Latest.
Prerequisites
Before we start, make sure you have the following:
- A running instance of nixOS with administrative privileges
- Access to the command-line interface
- A stable internet connection
Steps
- Open your command-line interface.
- Update the nix package manager by running:
sudo nix-channel --update && sudo nix-env -iA nixpkgs.nix
- Install Gatus from its GitHub repository by running:
git clone https://github.com/TwiN/gatus.git && cd gatus
- Compile Gatus by running:
sudo nix-env -if .
- Check the version of Gatus installed by running:
gatus --version
- Create a systemd service unit file called
gatus.serviceby running:
sudo nano /etc/systemd/system/gatus.service
- Inside nano, add the following lines to the file:
[Unit]
Description=Gatus Service
[Service]
User=root
Group=root
WorkingDirectory=/home/your_username/gatus/
ExecStart=/home/your_username/gatus/gatus
Restart=on-failure
RestartSec=10s
StartLimitBurst=3
StartLimitIntervalSec=60
[Install]
WantedBy=multi-user.target
Make sure to replace your_username with your actual username.
Save and close the file.
Start the Gatus service and enable it to start automatically at boot by running:
sudo systemctl start gatus && sudo systemctl enable gatus
- Verify that the service is running by running:
sudo systemctl status gatus
You should see a similar output:
● gatus.service - Gatus Service
Loaded: loaded (/etc/systemd/system/gatus.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-09-06 16:25:47 CST; 4s ago
Main PID: 38792 (gatus)
Tasks: 11 (limit: 18821)
Memory: 11.7M
CPU: 186ms
CGroup: /system.slice/gatus.service
└─38792 /nix/store/...
- Access the Gatus dashboard by opening a web browser and navigating to
http://localhost:8080on the machine where you installed Gatus.
That's it! You have successfully installed Gatus on nixOS Latest. You can now use it to monitor your microservices, APIs, and websites.