LibreNMS on Docker
LibreNMS is an open-source, auto-discovering network monitoring platform — SNMP polling, alerting, performance graphing, and OS detection across switches, routers, servers, and more, all from a single web UI. This guide deploys the official multi-container stack with Docker Compose: MariaDB for persistence, Redis for caching and the dispatcher queue, an msmtpd mailer, plus optional sidecars for the poller dispatcher, SNMP trap handling, and syslog ingestion.
| Requirement | Notes |
|---|---|
| Docker + Compose | Docker Engine v24+ and the Compose v2 plugin installed on the host |
| Linux server | Ubuntu 22.04+ or Debian 11+ recommended; a static IP or DHCP reservation that can reach the devices you intend to monitor |
| Port 8000 | The web UI is published on TCP 8000 by default — adjust firewall rules so you can reach it |
| SNMP reachability | UDP 161 open from the LibreNMS host to each monitored device; SNMP must be enabled on those devices |
The LibreNMS project maintains a ready-to-use Compose example. Download the archive, extract it, and work from the examples/compose directory. All paths in later steps are relative to that folder.
Two files drive the deployment. Edit .env for the timezone and database credentials, and librenms.env for application-level settings such as the SNMP community and worker counts. The database password is referenced by the db and librenms services through these variables, so set it once here.
StrongPasswordHere with a strong password. Set TZ to your real timezone — a mismatched timezone produces misleading graph timestamps and alert times.The official compose.yml defines the core services plus three optional sidecars. The db and redis services back the application; msmtpd relays mail. The dispatcher, snmptrapd, and syslogng containers reuse the same image with a sidecar flag. The structure below is abbreviated from the upstream example.
snmptrapd and syslogng sidecars follow the same pattern with SIDECAR_SNMPTRAPD=1 / SIDECAR_SYSLOGNG=1 and publish ports 162 and 514 respectively. Leave them out if you don't need trap or syslog ingestion yet — you can add them later.From inside examples/compose, bring everything up. On first start the LibreNMS container creates the database schema and runs migrations automatically — this can take a minute or two.
librenms logs show the migration finishing before opening the UI. Hitting the page mid-migration can show a blank or error screen — it resolves once startup completes.Unlike many appliances, LibreNMS has no default password. The first time you open the web UI it walks you through creating the administrator account. Browse to your server on port 8000 and append the install path:
Provide a username, a strong password, and an email address, then finish the wizard. You are redirected to the login page, and from there to the validation screen that confirms the database, schema, and services are healthy.
docker compose exec librenms lnms user:add -r admin <username>LibreNMS polls devices over SNMP. On each device you want to monitor, install and configure an SNMP agent. On a Linux target, the project ships a ready-made config — install snmpd, drop in the example file, and set your community string to match LIBRENMS_SNMP_COMMUNITY.
Open the file and replace RANDOMSTRINGGOESHERE with your community string (the Docker default is librenmsdocker), then update the syslocation and syscontact lines. Restart the agent:
With SNMP answering, add the device in the UI under Devices → Add Device. Enter the hostname or IP, choose the SNMP version, and supply the community string. LibreNMS auto-detects the OS and begins discovery and polling. You can also do it from the CLI:
Graphs populate after a few polling cycles (every five minutes by default). The dispatcher sidecar handles scheduling, so no host cron job is required.
| Task | Command |
|---|---|
| Start stack | docker compose up -d |
| Stop stack | docker compose down |
| View logs (live) | docker compose logs -f librenms |
| Check status | docker compose ps |
| Run validation | docker compose exec librenms php validate.php |
| Add admin user | docker compose exec librenms lnms user:add -r admin <name> |
| Set a config value | docker compose exec librenms lnms config:set <key> <value> |
| Upgrade | docker compose down && docker compose pull && docker compose up -d |
