How to Install OpenNMS on Debian 11

Install OpenNMS on Debian 11

In this article, we will have explained the necessary steps to install OpenNMS on Debian 11. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

OpenNMS (Open Network Management System) is a free and open-source java-based network monitoring tool. It is a network monitoring application that collects critical information from local and network hosts using the SNPM protocol. It runs on Linux and Windows operating systems and provides a web-based interface to easy monitoring.

Install OpenNMS on Debian 11

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade
sudo apt install curl build-essential gcc make

Step 2. Install OpenJDK.

Run the following command to install Java to your system:

Verify java version that is already installed:

java --version

Step 3. Install OpenNMS on Debian system.

Installing OpenNMS on your Debian system is straightforward, All you need to do is open a terminal and run the following command:

nano /etc/apt/sources.list.d/opennms.list

Add the following lines:

deb stable main
deb-src stable main

Next, the GPG key with the following command:

wget -O - | apt-key add -

After that, install the OpenNMS package to your system:

sudo apt update
sudo apt install opennms

The installation package will also install the PostgreSQL server package automatically, we will start it using the following command:

sudo systemctl start postgresql
sudo systemctl enable postgresql

Step 4. Configuring PostgreSQL Database.

Create a user for OpenNMS and set a password using the following command below:

createuser opennms
psql -c "ALTER USER opennms WITH PASSWORD 'opennms';"

Next, create a database for OpenNMS and set a password for Postgres users:

createdb -O opennms opennms
psql -c "ALTER USER postgres WITH PASSWORD 'your-strong-password';"

Step 5. Configure OpenNMS.

In this step, we will configure the OpenNMS data source by adjusting a file and defining database settings:

nano /usr/share/opennms/etc/opennms-datasources.xml

Add the following configuration:

<jdbc-data-source name="opennms"
                    password="opennms" />

  <jdbc-data-source name="opennms-admin"
                    password="your-strong-password" />

Then we will integrate OpenNMS with Java, by running the following command:

sudo -u opennms /usr/share/opennms/bin/runjava -s
sudo -u opennms /usr/share/opennms/bin/install -dis

Finally, start the OpenNMS service and enable it to start at system reboot using the following command:

sudo systemctl start opennms
sudo systemctl enable opennms

Step 6. Configure Firewall.

OpenNMS is using the default port on port 8980, If our OpenNMS is running on an active firewall, we need to allow the port as shown below :

sudo ufw allow 8980/tcp
sudo ufw reload
sudo ufw enable

Step 7. Accessing OpenNMS Horizon.

Now, open your web browser and access the OpenNMS web interface using the URL http://your-server-ip-address:8980. You will be redirected to the OpenNMS login page and enter your username and password as admin and click on the Login button.

Install OpenNMS on Debian 11

That’s all you need to do to install OpenNMS on Debian (Bullseye). I hope you find this quick tip helpful. For further reading OpenNMS horizon network monitoring on Debian’s system, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.