Docs

Data Folders & Bind Mounts

Your data lives in four real folders next to docker-compose.yml — no more hidden Docker volumes. You can see, browse, back up, and mount/unmount them without ever losing data.

The four folders

FolderInside the containerWhat it holds
nfsen-data//var/nfsen/profiles-dataRaw flow records (captured NetFlow files)
nfsen-stat//var/nfsen/profiles-statRRD graph files (the charts in the Web UI)
nfsen-var//var/nfsen/varLogs, cache, runtime files
nfsen-etc//var/nfsen/etcnfsen.conf (router sources config)

Why docker volume ls shows nothing

These four folders are bind mounts, not Docker volumes. docker volume ls only lists named volumes — bind mounts are plain host folders and are intentionally invisible there. That is normal and correct: the folders themselves are the storage. To confirm they are mounted, run docker inspect netlens and look at the Mounts section (each shows "Type": "bind" with the matching Source/Destination), or simply ls the four folders next to docker-compose.yml.

How the mounting actually works

Every line under volumes: in docker-compose.yml is a bind mount — one host folder "shared" with a path inside the container. Both sides see the same files:

Bind mount layout

VPS host (your server)sharedInside the container
./nfsen-data/

/var/nfsen/profiles-data/

raw NetFlow files

./nfsen-stat/

/var/nfsen/profiles-stat/

RRD graph files

./nfsen-var/

/var/nfsen/var/

logs + runtime

./nfsen-etc/

/var/nfsen/etc/

nfsen.conf (sources)

Both sides see the same files — what the container writes into its path lands in the host folder.

Example: when the collector saves flow data it writes to /var/nfsen/profiles-data/live/router1/ inside the container — and because of the mount, the file physically lands in nfsen-data/live/router1/ on your VPS. You can browse, copy, back up, or delete it directly from the host at any time.

Lifecycle rules

  • Mount / unmount = start / stop the container. docker compose down releases the mounts; docker compose up -d re-attaches them. The data never moves.
  • Data survives everything — rebuilds, recreates, and even docker compose down -v (that flag only deletes named volumes; your data lives in these host folders).
  • The only thing that deletes your data is rm -rf nfsen-data nfsen-stat nfsen-var nfsen-etc — stop the container first (see below).
  • An empty host folder hides the image's built-in content — that is why the entrypoint auto-seeds nfsen.conf into nfsen-etc/ and the live profile into nfsen-stat/ + nfsen-data/ on first start.

Back up anytime (container can keep running)

cp -a nfsen-data nfsen-data-backup or tar czf nfsen-backup.tar.gz nfsen-data nfsen-stat nfsen-var nfsen-etc

Clean up / delete the data folders

Because the folders are bind mounts, the running container is actively writing to them. Before deleting or cleaning a mounted folder, unmount it first (docker compose down).

clear flow data only
# 1) Unmount first
docker compose down

# 2) Delete only the flow data + graphs (keeps nfsen.conf / router sources)
rm -rf nfsen-data/live/* nfsen-stat/live/*

# 3) Remount — same config, empty graphs
sudo docker compose up -d

If the container is already stopped, the mounts are already released — you can delete the folders directly. The rule is simple: container stopped = folders free to delete; container running = unmount first.

Migrating from the old named volumes

If you already had data in the old Docker volumes and want to move it into the new folders:

migrate
cd netlens
git pull
sudo docker compose down          # stop the container first

# create the new folders first
mkdir -p nfsen-data nfsen-stat nfsen-var nfsen-etc

# copy the existing data from each old volume into its new folder
sudo cp -a /var/lib/docker/volumes/netlens_nfsen-data/_data/. nfsen-data/
sudo cp -a /var/lib/docker/volumes/netlens_nfsen-stat/_data/. nfsen-stat/
sudo cp -a /var/lib/docker/volumes/netlens_nfsen-var/_data/. nfsen-var/
sudo cp -a /var/lib/docker/volumes/netlens_nfsen-etc/_data/. nfsen-etc/

# fix ownership so NfSen can write to the copied data
sudo docker compose up -d
docker exec netlens chown -R netflow:www-data /var/nfsen/profiles-data/live/
docker exec netlens chown -R www-data:www-data /var/nfsen/profiles-stat/live/

# old volumes are now unused - you may delete them to free space
sudo docker volume rm netlens_nfsen-data netlens_nfsen-stat \
  netlens_nfsen-var netlens_nfsen-etc

If you pull and start without migrating, the new folders start empty — your old data stays safe in the named volumes, just not mounted. Do the copy steps above first if you want to keep existing graphs.