How To Install OpenNMS on Ubuntu 20.04 LTS

Install OpenNMS on Ubuntu 20.04

In this tutorial, we will show you how to install OpenNMS on Ubuntu 20.04 LTS. For those of you who didn’t know, OpenNMS is a free open source enterprise-level network monitoring and management platform that provides information to allow us to make decisions in regards to future network and capacity planning. OpenNMS designed to manage tens of thousands of devices from a single server as well as manage unlimited devices using a cluster of servers. It includes a discovery engine to automatically configure and manage network devices without operator intervention.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step by step installation of OpenNMS (Open Network Management System) on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian based distribution like Linux Mint.

Install OpenNMS on Ubuntu 20.04 LTS Focal Fossa

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Step 2. Installing Docker and Docker Compose.

Now download and add the GPT key with the following command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

Next, add the Docker repository to your system using the following command:

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

After adding the repo, hit the below command to install the docker and docker-compose:

sudo apt install docker-ce docker-ce-cli containerd.io docker-compose

Check the Docker compose version using the following command:

docker-compose -v

Step 3. Installing OpenNMS on Ubuntu 20.04.

First, create a project directory for OpenNMS with the following command:

sudo mkdir opennms

After that, change the directory to opennms and create a new docker-compose.yml file to install OpenNMS:

cd opennms
sudo nano docker-compose.yml

Add the following line:

version: '3'

volumes:
  data-postgres: {}
  data-opennms: {}

services:
  database:
    image: postgres:12
    container_name: database
    environment:
      - TZ=Europe/Berlin
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - data-postgres:/var/lib/postgresql/data
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U postgres" ]
      interval: 10s
      timeout: 30s
      retries: 3

  horizon:
    image: opennms/horizon:26.1.1
    container_name: horizon
    environment:
      - TZ=Europe/Berlin
      - POSTGRES_HOST=database
      - POSTGRES_PORT=5432
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - OPENNMS_DBNAME=opennms
      - OPENNMS_DBUSER=opennms
      - OPENNMS_DBPASS=opennms
    volumes:
      - data-opennms:/opt/opennms/share/rrd
      - ./overlay:/opt/opennms-overlay
    command: ["-s"]
    ports:
      - "8980:8980/tcp"
      - "8101:8101/tcp"
      - "61616:61616/tcp"
    healthcheck:
      test: [ "CMD", "curl", "-f", "-I", "http://localhost:8980/opennms/login.jsp" ]
      interval: 1m
      timeout: 5s
      retries: 3

Save and exit the file. Then, given a command to download & build the container for opennms:

docker-compose up -d
docker ps -a

Step 4. Accessing OpenNMS Web Interface.

OpenNMS will be available on HTTP port 8980 by default. Open your favorite browser and navigate to http://your-domain.com:8980 or http://server-ip-address:8980. Give the username and password whereas the default username and password is admin/admin.

Install OpenNMS on Ubuntu 20.04

Congratulations! You have successfully installed OpenNMS. Thanks for using this tutorial for installing OpenNMS (Open Network Management System) on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official OpenNMS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!