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:
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:
Add the following lines:
deb https://debian.opennms.org stable main deb-src https://debian.opennms.org stable main
Next, the GPG key with the following command:
wget -O - https://debian.opennms.org/OPENNMS-GPG-KEY | 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';" exit
Step 5. Configure OpenNMS.
In this step, we will configure the OpenNMS data source by adjusting a file and defining database settings:
Add the following configuration:
<jdbc-data-source name="opennms" database-name="opennms" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/opennms" user-name="opennms" password="opennms" /> <jdbc-data-source name="opennms-admin" database-name="template1" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/template1" user-name="postgres" password="your-strong-password" /> </datasource-configuration>
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.
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.