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.
# Install NetLens on your VPS
$ git clone https://github.com/rezwanvaiya2-0/netlens.git
$ cd netlens
$ sudo ./install.sh
NetLens packages the classic NfSen + NfDump NetFlow analysis stack into a single Docker container — production-grade traffic analysis without manual compiling and dependency management.
nfcapd listens on UDP ports 2055/2056 (plus any port you add) and captures NetFlow v5/v9/IPFIX from your routers.
Flow data lives in bind-mounted folders next to docker-compose.yml — visible, browsable, and it survives rebuilds.
The Web UI (port 8070) turns raw flows into RRD graphs — traffic, flows, and packets per source, behind a styled login page.
Set Expire / Max size per profile from the Web UI. The nfsend daemon enforces it automatically — no cron, no config edits.
Up and running in three commands. You need a VPS or server with Docker (Compose v2). First install takes a few minutes to build.
# 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
--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.Open http://<YOUR_IP>:8070/nfsen.php in your browser. The UI is password-protected — first login:
| Username | admin |
|---|---|
| Password | change-me-now |
docker exec netlens htpasswd -b /var/nfsen/etc/.htpasswd admin YourNewPass123
Your data lives in 4 real folders next to docker-compose.yml — no hidden Docker volumes:
| Folder | Inside the container | Holds |
|---|---|---|
nfsen-data/ | /var/nfsen/profiles-data | Raw NetFlow capture files |
nfsen-stat/ | /var/nfsen/profiles-stat | RRD graph files (the charts) |
nfsen-var/ | /var/nfsen/var | Logs, cache, runtime files |
nfsen-etc/ | /var/nfsen/etc | nfsen.conf (router sources) |
tar czf nfsen-backup.tar.gz nfsen-data nfsen-stat nfsen-var nfsen-etcdocker compose down -vrm -rf on the folders themselves deletes data (stop the container first)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
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.
Guides for going beyond the basics.
Full step-by-step guide: share the NfSen data folders over NFS (read-only) and show NetFlow graphs + Top-N stats inside LibreNMS.
Complete documentation: router sources, retention, password protection, security, storage recovery, and troubleshooting.
Found a bug or have a feature request? Open an issue on GitHub and we'll take a look.