How to Install LibreNMS on Fedora Server Latest

LibreNMS is a flexible and robust monitoring system that can be used to monitor a variety of devices on a network. In this tutorial, we will show you how to install LibreNMS on a Fedora Server Latest system.

Steps:

  1. Update the system.

    sudo dnf upgrade -y
    
  2. Install required packages.

    sudo dnf install epel-release git cronie fping ImageMagick jwhois mariadb mariadb-server mtr MySQL-python net-snmp net-snmp-utils nginx nmap php php-cgi php-common php-fpm php-gd php-mbstring php-mysqlnd php-process php-snmp unzip
    
  3. Enable and start required services.

    sudo systemctl enable cronie mariadb nginx php-fpm
    sudo systemctl start cronie mariadb nginx php-fpm
    
  4. Set MariaDB root password and create LibreNMS database.

    sudo mysql_secure_installation
    sudo mysql -u root -p
    CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_general_ci;
    GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost' IDENTIFIED BY '<password>';
    FLUSH PRIVILEGES;
    EXIT;
    

    Replace <password> with a secure password.

  5. Configure PHP.

    sudo cp /etc/php.ini /etc/php.ini.bak
    sudo sed -i 's|^;date.timezone =|date.timezone = UTC|' /etc/php.ini
    sudo sed -i 's|^memory_limit = 128M|memory_limit = 512M|' /etc/php.ini
    sudo sed -i 's|^;max_execution_time = 30|max_execution_time = 300|' /etc/php.ini
    sudo systemctl restart php-fpm
    
  6. Create a new LibreNMS user and group.

    sudo useradd librenms -d /opt/librenms -M -r
    sudo usermod -a -G librenms nginx
    
  7. Clone the LibreNMS repository.

    sudo git clone https://github.com/librenms/librenms.git /opt/librenms
    
  8. Install LibreNMS dependencies.

    sudo /opt/librenms/scripts/composer_wrapper.php install --no-dev
    
  9. Set permissions and ownership.

    sudo chown -R librenms:librenms /opt/librenms
    sudo chmod 770 /opt/librenms/bootstrap/cache /opt/librenms/storage
    sudo setfacl -d -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage
    sudo setfacl -R -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage
    
  10. Set up Nginx virtual host.

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

    Configure the virtual host file with the following content.

    server {
      listen 80;
      server_name <server_name>;
    
      root /opt/librenms/html;
      index index.php;
    
      access_log /var/log/nginx/librenms_access.log;
      error_log /var/log/nginx/librenms_error.log;
    
      location / {
        try_files $uri $uri/ /index.php?$query_string;
      }
    
      location ~ \.php$ {
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "upload_max_filesize = 10M \n post_max_size= 10M";
        fastcgi_param PATH_INFO $fastcgi_script_name;
      }
    }
    

    Replace <server_name> with the actual server name.

  11. Apply the changes.

    sudo nginx -t
    sudo systemctl restart nginx
    
  12. Set up LibreNMS.

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

    Configure the .env file with the following content.

    APP_URL=http://<server_name>
    DB_HOST=localhost
    DB_DATABASE=librenms
    DB_USERNAME=librenms
    DB_PASSWORD=<password>
    

    Replace <server_name> with the actual server name and <password> with the previously set database password.

  13. Run the installation script.

    sudo /opt/librenms/scripts/setup.php
    
  14. Log in to LibreNMS.

    Open your web browser and go to http://<server_name> to access LibreNMS. Log in with the default username admin and password admin.

Congratulations, you have successfully installed LibreNMS on Fedora Server Latest. You can now proceed to add devices to monitor and customize the dashboard to suit your needs.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!