How to install LibreNMS on POP! OS Latest

Introduction

LibreNMS is a free and powerful auto-discovering network monitoring system that is capable of monitoring devices in real-time. It provides an easy-to-use interface, along with advanced features such as alerting, automated discovery, and billing. In this tutorial, we will show you how to install LibreNMS on POP! OS Latest.

Prerequisites

Step 1: Update packages

First, update your system packages to the latest version by running the following commands:

sudo apt update
sudo apt upgrade

Step 2: Install Required Dependencies

Next, install the required dependencies:

sudo apt install apache2 php7.4 php7.4-cli php7.4-mysql php7.4-curl php7.4-gd php7.4-snmp php7.4-mbstring snmp fping mariadb-server mariadb-client libapache2-mod-php7.4 rrdtool composer

Step 3: Create a database

Create a new database and set up the user account by running the following commands:

sudo mysql -u root -p

Enter your MySQL root password when prompted, and then create a new database named librenms:

CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;
exit;

Remember to replace your-password with a strong password of your choice.

Step 4: Create a virtual host

Now, create a new virtual host for LibreNMS by creating a new Apache configuration file.

sudo nano /etc/apache2/sites-available/librenms.conf

Add the following lines to the file:

<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName librenms.example.com
DocumentRoot /opt/librenms/html/
CustomLog /var/log/apache2/librenms-access_log combined
ErrorLog /var/log/apache2/librenms-error_log
<Directory "/opt/librenms/html/">
  AllowOverride All
   Require all granted
</Directory>
</VirtualHost>

Remember to replace admin@example.com with your email address and librenms.example.com with your own domain name.

Enable the virtual host and restart Apache:

sudo a2ensite librenms
sudo systemctl restart apache2

Step 5: Install LibreNMS

Download the latest release from the LibreNMS website:

cd /opt
sudo wget https://github.com/librenms/librenms/archive/refs/tags/21.11.0.tar.gz
sudo tar zxvf 21.11.0.tar.gz
sudo mv librenms-21.11.0 librenms

Update the permissions with the following command:

sudo chown -R librenms:librenms /opt/librenms

Step 6: Install Required Packages

Install the required packages:

cd /opt/librenms
sudo ./scripts/composer_wrapper.php install --no-dev

Step 7: Configure LibreNMS

Next, run the following command to configure LibreNMS:

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

Update the following lines in the .env file with the appropriate values:

DB_HOST=localhost
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=<your-password>

Save and close the file.

Step 8: Initialize the database

Run the following command to initialize the database:

sudo /opt/librenms/daily.sh

Step 9: Configure SNMP

Configure SNMP for LibreNMS by editing the SNMP configuration file:

sudo nano /etc/snmp/snmpd.conf

Uncomment the following lines:

rocommunity public 127.0.0.1
rocommunity public <ip-of-server>

Replace <ip-of-server> with the IP address of your server. Save and close the file.

Restart the SNMP service to apply the changes:

sudo systemctl restart snmpd

Step 10: Access LibreNMS

Once everything is set up, you can access the LibreNMS web interface at http://librenms.example.com (replace librenms.example.com with your domain name). Log in using the default credentials:

You should change this password as soon as possible.

Conclusion

That's it! You now have LibreNMS up and running on POP! OS Latest. You can now start monitoring your network devices in real-time using this powerful tool.

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!