FedoraRHEL Based

How To Install LibreNMS on Fedora 38

Install LibreNMS on Fedora 38

In this tutorial, we will show you how to install LibreNMS on Fedora 38. In today’s fast-paced digital world, network monitoring is indispensable. Keeping a vigilant eye on your network’s health and performance can prevent potential issues and ensure seamless operations. LibreNMS, an open-source network monitoring system, is a powerful tool that can help you achieve just that.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of LibreNMS on a Fedora 38.

Prerequisites

  • A server running one of the following operating systems: Fedora 38.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A stable internet connection is crucial as we’ll be downloading and installing various packages and dependencies from remote repositories.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install LibreNMS on Fedora 38

Step 1. Before we can install LibreNMS on Fedora 38, it’s important to ensure that our system is up-to-date with the latest packages. This will ensure that we have access to the latest features and bug fixes and that we can install LibreNMS without any issues:

sudo dnf update
sudo dnf install git fping cronie composer cronie-anacron ipmitool

Step 2. Installing Nginx.

Nginx is a high-performance web server that will serve as the web interface for LibreNMS. Install it by running:

sudo dnf install nginx

Now, start Nginx and enable it to start on boot:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 3. Installing MariaDB.

LibreNMS relies on a database to store network data. We’ll use MariaDB for this purpose. Install MariaDB and secure it:

sudo dnf install mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation

During the MariaDB secure installation, set a strong root password, and answer “Y” (yes) to the other prompts.

Next, create a MariaDB Database for LibreNMS:

mysql -u root -p

Enter the MariaDB root password when prompted. Now, create a database for LibreNMS:

CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'your_password'; # Replace 'your_password' with a secure password
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4. Installing PHP.

PHP is essential for processing web-based requests and rendering web pages. Install PHP and the required extensions:

sudo dnf install php php-cli php-fpm php-mysqlnd php-zip php-gd php-mbstring php-curl php-xml php-json php-snmp php-intl php-ldap php-common php-opcache php-memcached

Next, we need to adjust the PHP configuration. Open the PHP-FPM configuration file:

sudo nano /etc/php-fpm.d/librenms.conf

Add the following lines to the file:

user = nginx
group = nginx

Save the file, then restart PHP-FPM:

sudo systemctl restart php-fpm

Step 5. Installing Composer and Required Packages

Composer is a PHP package manager that we’ll use to manage LibreNMS dependencies. Install Composer:

sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Install the required Composer packages for LibreNMS:

cd /opt/librenms
sudo composer install --no-dev

Step 6. Installing LibreNMS on Fedora 38.

Now, we’re ready to download and configure LibreNMS. Change to the /opt directory and clone the LibreNMS repository:

cd /opt
sudo git clone https://github.com/librenms/librenms.git

Set the correct permissions:

sudo chown -R nginx:nginx /opt/librenms

Create the configuration file:

sudo cp /opt/librenms/.env.example /opt/librenms/.env

Edit the configuration file:

sudo nano /opt/librenms/.env

Adjust the database settings according to your MySQL setup:

DB_HOST=localhost
DB_NAME=librenms
DB_USER=librenms
DB_PASS=your_password

Run the LibreNMS installation script, which will set up the necessary database tables and configure LibreNMS:

sudo /opt/librenms/scripts/install.sh

Follow the on-screen instructions. When prompted, select ‘yes’ to create the initial admin user.

Step 7. Create a Virtual Host Configuration for Nginx.

Create a new Nginx server block configuration file:

sudo nano /etc/nginx/conf.d/librenms.conf

Add the following configuration, replacing your_domain.com with your actual domain name:

server {
    listen 80;
    server_name your_domain.com; # Replace with your domain

    root /opt/librenms/html;
    index index.php;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }
}

Save the file, then enable the Nginx virtual host configuration and create a DNS record pointing to your server’s IP address:

sudo ln -s /etc/nginx/sites-available/librenms.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Step 8. Set Up a Firewall

Enable the firewall and allow HTTP and HTTPS traffic:

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --zone=public --add-service=https --permanent
sudo firewall-cmd --reload

Step 9. Accessing LibreNMS Web UI.

Access your LibreNMS web interface by navigating to http://your_domain.com. Follow the on-screen instructions to create the initial admin user and configure the basic settings.

Install LibreNMS on Fedora 38

Congratulations! You have successfully installed LibreNMS. Thanks for using this tutorial for installing LibreNMS on your Fedora 38 system. For additional help or useful information, we recommend you check the official LibreNMS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button