Posted On

2017 Dec 09

almost 7 years ago

Updated On

2023 Oct 07

about 1 year ago

Archive and Changelog

Update - 25 Jun, 2023

Changelog

  • Added logs inspection to MariaDB container setup to make sure DB is ready before proceeding
  • MariaDB container docker run command updated to use mariadb instead of mysql when setting up permissions

Versions

LibreNMS - 23.5.0 - Fri May 19 2023 23:32:19 GMT+0800
MariaDB Docker Container - 11.0.2-MariaDB-1:11.0.2+maria~ubu2204
Synology DSM - DSM 7.1.1-42962 Update 5

Users contributed to the update: canders1212, Banginis

Update - Jul 23, 2020

Tutorial fully working again :)

Credits to Jari Schäfer for pointing me in the right direction. Details @ https://github.com/jarischaefer/docker-librenms/issues/118

  • Changelog
    • Choosing a different hostname alias other than "db" when linking MariaDB container to LibreNMS container
    • SQL database options as per official LibrerNMS documentation
  • Synology DSM 6.2.3-25426
    • Version 1.65.1 - Sat Jul 11 2020 03:56:16 GMT+0800
  • Ubuntu 18.04.4 LTS (VM)
    • Version 1.65.1 - Sat Jul 11 2020 03:56:16 GMT+0800

2021-04-20 - Archived myLibreNMS App section from Page 2

myLibreNMS app via LibreNMS API

Jul 20, 2020 : App has not been updated in a long time

View your LibreNMS from your mobile device, great for road warriors and VPN users

First, create an API token in LibreNMS

Settings (Gear Icon) >> API >> API Settings >> Create API access token

After your access token has been created, you can click on the QR code blue icon to create a QR image which will be read by your iOS LibreNMS app

Download the iOS LibreNMS app

Ensure when entering URL of your LibreNMS server in the iOS app, it contains the full URL eg "http://ip-or-hostname:port"

Tap on the square box (marked by a yellow arrow on the screenshot), to scan your generated QR code in LibreNMS

Thank you all User comments

Seems like its high time for me to update this post to the latest steps as users are encountering errors/problems during installation

(Archive) LibreNMS v1.43 - Thank you Evert Meulie

A big part of this tutorial have been changed due to changes made in LibreNMS and also jarischaefer's image. Huge thanks to Evert Meulie for initially following my tutorial, commented about TZ and then reported back to me that the container started and stopped, which led me to try out my tutorial from scratch with a new docker container. Indeed, my tutorial stopped working as intended

As I will need more time to read up on the major changes/release notes on LibreNMS, I have temporarily typed up some commands to get you started and run a working example in the end. You can follow exactly as it is, or change the values accordingly as written out in the ## comments

Copy this block of commands into a text file and edit accordingly, especially if you are not on a Syno box, you will most definitely not have "/volume1/docker". Note: This is a quick way of getting MariaDB and LibreNMS container started and working with default values Eg: Test environment

If you want to understand how the values/commands come about, you can read the rest of the tutorial to understand a little bit more on what these values mean

Tested on the following:

LibreNMS 1.43 - Fri Aug 31 2018 16:37:38 GMT+0800 MariaDB 10.3.10-MariaDB-1:10.3.10+maria~bionic

##### quick run and test installation of librenms
### 1 - Prepare folders
## replace folder with your docker folder
cd /volume1/docker/

mkdir mariadb
mkdir librenms
cd librenms
mkdir logs
mkdir rrd
touch custom.config.php

### 2 - mariadb docker run commands

## replace if needed to point to your docker folder -v /volume1/docker/:/var/lib/mysql 
## replace TZ values if needed
## replace MYSQL_ROOT_PASSWORD= if needed

docker run --name mariadb 
 -v /volume1/docker/mariadb:/var/lib/mysql 
 -e MYSQL_ROOT_PASSWORD=testp@ssword 
 -e TZ=Asia/Singapore 
 -d mariadb:latest --sql-mode=''

### 3 - manually create a database called "librenms" in MariaDB container
docker exec -it mariadb mysql -u root -p

CREATE DATABASE librenms;
quit

### 4 - generate APP_KEY as per jarischaefer's instructions
## copy this APP_KEY value somewhere, includes "base64"
MY_APP_KEY=`docker run --rm jarischaefer/docker-librenms generate_key` && echo "Your LibreNMS APP Key is: $MY_APP_KEY"

### 5 - librenms docker run commands

## replace -v variables if needed to point to your docker/librenms location
## replace -e BASE_URL with your NAS IP
## replace TZ values if needed
## replace DB_PASS= if needed, same as your MariaDB password above

docker run 
 -d 
 -p 8668:80 
 -e APP_KEY=paste_your_generated_APP_key_here 
 -e DB_HOST=db 
 -e DB_USER=root 
 -e DB_NAME=librenms 
 -e DB_PASS=testp@ssword 
 -e BASE_URL=http://NAS-IP:8668 
 -e TZ=Asia/Singapore 
 --link mariadb:db 
 -v /volume1/docker/librenms/logs:/opt/librenms/logs 
 -v /volume1/docker/librenms/rrd:/opt/librenms/rrd 
 -v /volume1/docker/librenms/custom.config.php:/opt/librenms/conf.d/custom.config.php 
 --name librenms 
 jarischaefer/docker-librenms:latest

### 6 - initial librenms & mariadb setup database
docker exec librenms setup_database

### 7 - creates an admin user called "admin" with password "admin"
docker exec librenms create_admin

### Tested on
### LibreNMS 1.43 – Fri Aug 31 2018 16:37:38 GMT+0800
### MariaDB 10.3.10-MariaDB-1:10.3.10+maria~bionic

The above block of commands is not a full linux script, so you can't just copy and paste the whole thing into your terminal and expect it to work ;)

I have made some comments in it for better understanding, it should take you 8 copy-and-paste steps :)

  1. Prepare folders
  2. MariaDB docker run commands
  3. Manually create a database called "librenms" in MariaDB container
  4. Generate APP_KEY as per jarischaefer's instructions
  5. LibreNMS docker run commands
  6. Initial LibreNMS & MariaDB setup database
  7. Creates an admin user called "admin" with password "admin"

If you are planning to read the rest of this tutorial, the noticeable changes/additions to the original steps are:

  • Manually creating a MariaDB SQL database named "librenms"
  • Generating APP_KEY value prior to the full "librenms docker run" command
  • The rest of the steps are somewhat similar, they may be setting changes in the custom.config.php, which you would need to read up on LibreNMS and/or jarischaefer's documentation

Let me know in the comments if this newest step/tutorial update worked out for you! If you need help and is using Discord, you can contact me via my Discord server at the bottom of the page

(Archive) Changelog

Jul 20, 2020

Latest working version: v1.63 with regards to jarischaefer/docker-librenms's image

Edited post to use tag 1.63 instead of latest to ensure tutorial works

Details here

  • Version 1.63 - Tue Apr 28 2020 11:52:42 GMT+0800

Aug 30, 2019

  • Tutorial updated to latest working steps and versions
    • DSM 6.2.2-24922 Update 2
    • LibreNMS - 1.54
    • MariaDB - 10.4.7-MariaDB-1:10.4.7+maria~bionic
  • Updated screenshots
  • Re-arranged/deleted some old bloggy content
  • Post split up to three pages as it gets rather long trying to scroll down to the comments section
    • Page 1
      • The main setup and installation
    • Page 2
      • Optional(s) and Troubleshooting
    • Page 3
      • Archives
  • Less layman, tiny bit more technical :)

Oct 09, 2018

  • Major change/overhaul to this tutorial with LibreNMS 1.43 & jarischaefer's new image instructions
    • >> Moved to Page 3 as Credits/Thanks

Aug 24, 2018

  • Portainer
    • Added "Reduce/Minimum downtime during upgrade"
  • Network troubleshooting
    • Added "Troubleshooting steps"
  • Alerting
    • LibreNMS sent to Discord eyecandy ;)

Jun 23, 2018

  • "Updating Containers"
    • Added "Portainer"

May 20, 2018

  • Docker run examples updated to match jarischaefer's custom PHP template
    • Added <?php on front as per jarischaefer's instructions
  • Added "Updating Containers" section
  • Added "Networking issues & a quick 101" in the Troubleshooting section
Copyright © 2012 - 2024 Jason Loong and jasonloong.com
Logo by itsjanelia
Excerpts and links may be used, provided that full and clear credit is given to Jason Loong and jasonloong.com with appropriate and specific direction to the original content. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited.
jasonloong.com site uptime badge