From OpenNMS
Jump to: navigation, search

Warning.png Official Install Guide

With OpenNMS Horizon we have now a version controlled official install guide which can be found here: This wiki is going to be deprecated.

This tutorial covers installation of OpenNMS on Debian, and Debian-derived distributions like Ubuntu.

This page was tested with:

  • OpenNMS 16.0.3-1 on Ubuntu 14.04.3 LTS 64-bit

Select Your Release and Distribution

In order to tailor this tutorial to your distribution, please specify the release you decided upon previously, as well as your distribution version:

Hint: Please make sure you have JavaScript activated in your browser to have a more convenient wiki page for your linux distribution.

Release in OpenNMS means: stable, testing, unstable, snapshot

Configure APT

Adding a Repository

To set up APT to talk to the OpenNMS repository, you'll need to create a file called "opennms.list" within the "/etc/apt/sources.list.d" directory, with the following contents to install OpenNMS stable release:

# contents of /etc/apt/sources.list.d/opennms.list
deb stable main
deb-src stable main

The following commands will create this file for you:

cat << EOF | sudo tee /etc/apt/sources.list.d/opennms.list
# contents of /etc/apt/sources.list.d/opennms.list
deb stable main
deb-src stable main

Replace stable to install other releases of OpenNMS

Adding the OpenNMS PGP Key to APT

Packages within the APT system are cryptographically signed to ensure their integrity. This step ensures the integrity of the file you've downloaded, as well as a reference to guarantee that the file is provided by who it says it was. These features are useful at install-time as well as during future upgrades.

To install the OpenNMS PGP key into your system, type the following at a command prompt:

wget -O - | sudo apt-key add -

Download and verify OpenNMS package catalogs have been downloaded

Then you should be able to run
sudo apt-get update
to get the latest list of packages in your APT repositories, including those in the OpenNMS repository.

Note.png Try It! Check for OpenNMS Packages

Once you've configured APT for the release of your choice, a query of the APT database should show a number of OpenNMS packages as available install options when you run "apt-cache search opennms", for example:

sudo apt-get update
apt-cache search opennms

You should see a list of OpenNMS-related packages found in this search.

To confirm the version of OpenNMS that will be installed, query the OpenNMS package itself for details. This version should match the expected desired version (stable, unstable, etc.). In the example below, the current stable version of OpenNMS (as of Mar. 31, 2015), ver. 15.0.1-1, is shown in the current package cache.

[user@host tmp] apt-cache show OpenNMS
Package: opennms
Priority: optional
Section: contrib/net
Installed-Size: 26
Maintainer: Jeff Gehlbach <>
Architecture: all
Version: 16.0.3-1

Preparing the Database for OpenNMS

Before installing OpenNMS itself, you will want to install PostgreSQL, and do a few things to make sure PostgreSQL is working properly.

Installing PostgreSQL

The first thing you'll want to do is install the PostgreSQL database itself. On any Debian-based distribution, all you should have to do is install the "postgresql" package, and it will pull in anything it needs.

sudo apt-get update
sudo apt-get install postgresql

Determining Your PostgreSQL Version

The version of PostgreSQL that gets installed depends upon what version distribution you're running. You can see the version of PostgreSQL installed with the "pg_lsclusters" command. For the purposes of this tutorial, we'll set an environment variable on the shell to make things easier:

PGVERSION=`pg_lsclusters -h | head -n 1 | cut -d' ' -f1`


Example output with PostgreSQL 9.3 installed:


Allowing User Access to the Database

By default, PostgreSQL only allows you to connect if you are logged in to the local account name that matches the PostgreSQL user. Since OpenNMS runs as root, it cannot connect as the operating system's "postgres" or "opennms" users by default, so we have to change the configuration to allow that.

To allow connections as the postgres user to authenticate without a password, you first must change options in the pg_hba.conf file. On Debian-derived systems, this will be located at /etc/postgresql/$PGVERSION/main/pg_hba.conf, where "$PGVERSION" is the environment variable we set earlier containing the version of your PostgreSQL database.

Edit your "/etc/postgresql/$PGVERSION/main/pg_hba.conf" file now, as root. It should have entries similar to the following at the bottom.

sudo vi /etc/postgresql/$PGVERSION/main/pg_hba.conf

The following example is from PostgreSQL 9.3:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

You will need to change these entries to replace the default authentication methods with the method "trust". The final result should be like the following.

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# OpenNMS change: configure local, IPv4 and IPv6 connections made from localhost to not require authentication

# "local" is for Unix domain socket connections only
local   all             all                                     trust # the default method is peer
# IPv4 local connections:
host    all             all               trust # the default method is md5
# IPv6 local connections:
host    all             all             ::1/128                 trust # the default method is md5

Once you have finished making changes, restart the database (as root):

sudo service postgresql restart

On older releases of Debian, you may need to instead run "sudo service postgresql-$PGVERSION restart"

On older releases of Ubuntu such as Ubuntu 10.04 with PostgreSQL 8.4, you may need to instead run "sudo service postgresql-$PGVERSION restart"

Additionally, while it's beyond the scope of this beginning tutorial, you may want to check the PostgreSQL section of the Performance Tuning page to get the most out of your database installation.

Warning.png Security Implications

The above changes to the default PostgreSQL configuration will make it easy to install OpenNMS on your server, but it also allows for anyone with a local user account to have full access to said DB. As this guide is a quick start, the assumption is that the server is limited to users of the OpenNMS system. If this is not the case, you should consult the PostgreSQL documentation for setting a more restrictive environment.

Installing Java

You'll need to install the Oracle Java 8 package or OpenJDK Java 8 package in order to satisfy the dependencies of the OpenNMS package.

Warning.png Java 8 is required beginning with OpenNMS 16

Starting with release 16, OpenNMS requires Java 8. Previous releases are not supported on Java 8. Please use Java 7 for OpenNMS 15.x and below.

Oracle Java 8

Warning.png Oracle JDK

Use of the Oracle JDK is still very much recommended, though the Debian packages do pull in the OpenJDK. If you experience issues, try using the Oracle JDK as a first step.

For Debian, see the instructions at for how to do this before progressing to installing OpenNMS.

For Ubuntu, Oracle Java is not available in the standard Ubuntu repositories. The Ubuntu wiki at outlines other options. One recommendation there is to use the WebUpd8 package archives method described at as this will also keep the Oracle JDK up to date as new releases come out.

These are the Ubuntu WebUpd8 Oracle Java installation commands.

# install the add-apt-repository program
sudo apt-get install software-properties-common

# add the private package archive webupd8team/java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

# install Oracle Java8
sudo apt-get install oracle-java8-installer

# setup Oracle Java8 to be the default Java VM
sudo apt-get install oracle-java8-set-default

OpenJDK Java 8

If the Oracle Java package is not being used, install the OpenJDK Java package with apt-get as root.

On Ubuntu 15.04 or later, OpenJDK Java 8 is available in the standard Ubuntu repositories. Earlier versions of Ubuntu only have OpenJDK Java 7 available.

sudo apt-get update
sudo apt-get install openjdk-8-jdk

Verification of the Java version

java -version

This is sample output using Oracle Java 8.

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Verification of a local mail transfer agent

OpenNMS sends out e-mail by default through a local mail transfer agent listening on port 25. Confirm that a MTA (e.g. exim or postfix) is installed. One way to check for this is to telnet to port 25 on the server and ensure a SMTP banner is displayed.

If a MTA is not present, install it with the following command:

sudo apt-get install default-mta

For Debian, the default MTA is exim. Accept the default debconf configuration responses when configuring exim.

For Ubuntu, the default MTA is postfix. When asked what mail configuration to use, select the default option, "Internet Site" and the default hostname of the server on the next configuration page.

Installing OpenNMS

With all the prerequisites taken care of, you can now install OpenNMS. The OpenNMS software is not a single package, but a combination of many components. The APT packaging system will download and install all of these components and their dependencies, if they are not already installed on your system.

There are many packages available in the OpenNMS APT repository, but the easiest way to get started is to install the "opennms" package. This will pull in everything you need to have a working OpenNMS, including the OpenNMS core, web UI, and a set of common plugins.

You can do so by running (as root):

sudo apt-get install opennms

The installer typically has two prompts: "The OpenNMS installer must now be run manually" and a warning that "IPLIKE installation failed". Please select "<Ok>" for both questions to continue.

The IPLIKE warning is normal, as this package will attempt to install itself into the OpenNMS database, but on a new install the database has not been configured yet. We will re-attempt the install later.

Note.png Try It! Install OpenNMS

Install OpenNMS, using the "sudo apt-get install opennms" command (as root).

sudo apt-get install opennms

You should see something like this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  iplike-pgsql93 jicmp jicmp6 libauthen-sasl-perl libdbd-pg-perl libdbi-perl
  libencode-locale-perl libfile-listing-perl libfont-afm-perl
After this operation, 711 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Post-Install Configuration

Optional: Disable OpenNMS updates

Your operating system may be configured to do automatic updates of all packages at regular intervals or a system administrator could potentially run a manual update and inadvertently upgrade OpenNMS resulting in a misconfiguration or complete failure.

To avoid these scenarios, you may want to disable the OpenNMS repositories after a successful installation by editing the "/etc/apt/sources.list.d/opennms.list" file and commenting out each "deb" section by adding a # to the start of each line. This can just as easily be changed back when it's time to upgrade.

Configure Java

Next, you need to tell OpenNMS which Java you want it to use, using the "$OPENNMS_HOME/bin/runjava" command.

To have OpenNMS search for and auto-detect the JRE, run:

sudo $OPENNMS_HOME/bin/runjava -s

Example output:

runjava: Looking for an appropriate JRE...
runjava: Checking for an appropriate JRE in JAVA_HOME...
runjava: skipping... JAVA_HOME not set
runjava: Checking JRE in user's path: "/usr/bin/java"...
runjava: found an appropriate JRE in user's path: "/usr/bin/java"
runjava: value of "/usr/bin/java" stored in configuration file

To configure OpenNMS to use a specific JRE binary, use the "-S" with the path to the desired binary.

sudo $OPENNMS_HOME/bin/runjava -S /usr/bin/java

Create/Update the OpenNMS Database

Whenever you install OpenNMS or upgrade it, you should run the "sudo $OPENNMS_HOME/bin/install -dis" command, to create the OpenNMS database, or update it to the latest version. The install command takes many options, but in most cases all you should need are the three options below:

  • -d - to update the database
  • -i - to insert any default data that belongs in the database
  • -s - to create or update the stored procedures OpenNMS uses for certain kinds of data access

A warning "Failed to load the optional jrrd library." during installation is normal and not a problem, as jrrd use is optional. The installation should finish with the line "Installer completed successfully!".

Note.png Try It! Create the Database

Now it's time to create and configure the OpenNMS database. To do so, run the following command (as root):

sudo $OPENNMS_HOME/bin/install -dis

You should get output something like this:

OpenNMS Installer

Configures PostgreSQL tables, users, and other miscellaneous settings.

- searching for
  - trying to load / NO
  - trying to load /usr/share/opennms/lib/ NO
  - trying to load /usr/share/opennms/lib/linux64/ NO
  - trying to load /usr/java/packages/lib/amd64/ NO
  - trying to load /usr/lib/jni/ OK
- searching for
  - trying to load / NO
  - trying to load /usr/share/opennms/lib/ NO
  - trying to load /usr/share/opennms/lib/linux64/ NO
  - trying to load /usr/java/packages/lib/amd64/ NO
  - trying to load /usr/lib/jni/ OK
- searching for
  - trying to load / NO


Installer completed successfully!

OpenNMS Upgrader


Upgrade completed successfully!

Warning.png Java Network unreachable

If you try to install OpenNMS on Debian 6.0 Squeeze you may get a PostgreSQL error Network unreachable. In Debian 6.0 Squeeze Java applications are not allowed to connect to It is only possible to connect to ::1 by default. The bug is described in

It seems that adding "" to the list of arguments in file $OPENNMS_HOME/bin/install solves the problem.

(Optional but recommended) Install IPLIKE database stored procedure

OpenNMS uses a PostgreSQL stored procedure called "IPLIKE" which provides an API for easily performing complicated IP address queries. By default, OpenNMS installs a version of IPLIKE that is compatible with all versions of PostgreSQL, but there is a platform-specific version of IPLIKE with much better performance. While it is optional, it is recommended that you configure the iplike package from APT for performance reasons.

The appropriate IPLIKE package (eg, iplike-pgsql84, iplike-pgsql90, etc.) for your database should already have installed when you installed the main "opennms" package. All you should need to do is re-run the "install_iplike" shell script (as root):

sudo /usr/sbin/

This is the expected output if the installation was successful:


Verify connectivity to the OpenNMS database

At this point, you can check the network listener and authentication changes, as well as whether or not your DB creation worked properly by trying to connect to the OpenNMS database as the postgres database user from localhost.

psql -U postgres --host=localhost opennms

If you are presented with a prompt that looks like opennms=#, you can type \q and quit the PostgreSQL shell as the database connection was successful. If this was not successful, you will need to review your PostgreSQL configuration before continuing.

Start OpenNMS and Connect to the Web UI

You can now start OpenNMS using the "service" command (as root).

Note.png Try It! Connect to the Web UI

Try starting OpenNMS, and connecting to the web UI.

sudo service opennms start

You should be able to go to http://YOUR-OPENNMS-IP:8980/opennms/ in your browser and see the web UI. The default username and password are both "admin" so enter them in when you see the login prompt.

Change the Administrator Password

As mentioned above, the default username is "admin" and the default password is "admin" as well. It is recommended that you change the administrator user's password, for security reasons. To do so, log in to the web UI and then click on the username (admin) in the upper-right corner, and then click "Change Password." Enter the old and new passwords in the prompt, and click "OK."

Note.png Try It! Change the Default Password

To change the default password, browse to http://YOUR-OPENNMS-IP:8980/opennms/ and log in as administrator:

Log In as Admin

...then click the admin username in the upper-right corner:

Edit Admin User

...and finally, click "Change Password," then fill out the form.

Next-arrow.png Next Step: Scan Your First Device

Now that OpenNMS is installed, it's time to scan your first device! Let's move on to the Capability Scanning tutorial.