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
| Folder | Inside the container | What it holds |
|---|---|---|
nfsen-data/ | /var/nfsen/profiles-data | Raw flow records (captured NetFlow files) |
nfsen-stat/ | /var/nfsen/profiles-stat | RRD graph files (the charts in the Web UI) |
nfsen-var/ | /var/nfsen/var | Logs, cache, runtime files |
nfsen-etc/ | /var/nfsen/etc | nfsen.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
/var/nfsen/profiles-data/
raw NetFlow files
/var/nfsen/profiles-stat/
RRD graph files
/var/nfsen/var/
logs + runtime
/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 downreleases the mounts;docker compose up -dre-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.confintonfsen-etc/and theliveprofile intonfsen-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-etcClean 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).
# 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 -dIf 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:
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-etcIf 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.