See your network flows clearly

A self-contained Docker image for NetFlow analysis — NfSen 1.3.6p1 + NfDump 1.6.17 with a password-protected Web UI. Collect, store, and visualize router traffic with one command.

bash
# Install NetLens on your VPS
$ git clone https://github.com/rezwanvaiya2-0/netlens.git
$ cd netlens
$ sudo ./install.sh
NfSen 1.3.6p1 NfDump 1.6.17 Ubuntu 20.04 Docker Web UI Port 8070 NetFlow UDP 2055/2056 License: BSD-3-Clause

What is NetLens?

NetLens packages the classic NfSen + NfDump NetFlow analysis stack into a single Docker container — production-grade traffic analysis without manual compiling and dependency management.

Collect

nfcapd listens on UDP ports 2055/2056 (plus any port you add) and captures NetFlow v5/v9/IPFIX from your routers.

Store

Flow data lives in bind-mounted folders next to docker-compose.yml — visible, browsable, and it survives rebuilds.

Visualize

The Web UI (port 8070) turns raw flows into RRD graphs — traffic, flows, and packets per source, behind a styled login page.

Retain

Set Expire / Max size per profile from the Web UI. The nfsend daemon enforces it automatically — no cron, no config edits.

Installation

Up and running in three commands. You need a VPS or server with Docker (Compose v2). First install takes a few minutes to build.

Quick start

# 1. Clone the repository
git clone https://github.com/rezwanvaiya2-0/netlens.git
cd netlens

# 2. Build & start (same as: docker compose up -d --build)
sudo ./install.sh
First run only: the --build flag is needed just once. After that, docker compose up -d starts the container in seconds — your sources, config, and data persist in the folders next to docker-compose.yml.

Access the Web UI

Open http://<YOUR_IP>:8070/nfsen.php in your browser. The UI is password-protected — first login:

Usernameadmin
Passwordchange-me-now
Change the password immediately — one command, takes effect instantly, no restart needed:
docker exec netlens htpasswd -b /var/nfsen/etc/.htpasswd admin YourNewPass123

Data folders

Your data lives in 4 real folders next to docker-compose.yml — no hidden Docker volumes:

FolderInside the containerHolds
nfsen-data//var/nfsen/profiles-dataRaw NetFlow capture files
nfsen-stat//var/nfsen/profiles-statRRD graph files (the charts)
nfsen-var//var/nfsen/varLogs, cache, runtime files
nfsen-etc//var/nfsen/etcnfsen.conf (router sources)

Connect a router

UDP ports 2055 and 2056 are pre-opened, with a demo router1 source so the UI shows graphs on first install. To add a router on a new port:

# 1. Open the port in docker-compose.yml under ports:
#    - "2070:2070/udp"

# 2. Add the router source (persists forever)
docker exec netlens bash -c "sed -i \"/^);$/i\\    'myrouter' => { 'port' => '2070', 'col' => '#FF0000', 'type' => 'netflow' },\" /var/nfsen/etc/nfsen.conf && /var/nfsen/bin/nfsen reconfig"

# 3. Recreate the container (~3 seconds, no rebuild, no data loss)
docker compose up -d

Set data retention

From the Web UI: Profile Admin → live profile → Edit. Set Expire (max age, e.g. 3d) and Max size (hard disk cap, e.g. 44G), then Save. The daemon enforces it automatically within minutes.

Documentation

Guides for going beyond the basics.

LibreNMS Integration

Full step-by-step guide: share the NfSen data folders over NFS (read-only) and show NetFlow graphs + Top-N stats inside LibreNMS.

README (full reference)

Complete documentation: router sources, retention, password protection, security, storage recovery, and troubleshooting.

Report an issue

Found a bug or have a feature request? Open an issue on GitHub and we'll take a look.