Synology NAS

On a Synology use a Project (that is Container Manager’s name for a compose file). The graphical “Create container” wizard of Container Manager does not let you choose individual capabilities (it only has an all-or-nothing high privilege switch, which gives the container far more rights than Netlens needs). In a Project the two capabilities are simply lines in the file.

  1. Open Container Manager → Project → Create.
  2. Project name: netlens. Path: press Set path and pick or create a shared folder for it (for example docker/netlens); this only holds the compose file.
  3. Source: choose Create docker-compose.yml. An editor opens.
  4. Paste the complete file from Where do NET_RAW and NET_ADMIN go? (or the contents of docker-compose.simple.yml). network_mode: host and the cap_add: list are already in it. Set TZ to your time zone if you like.
  5. Press Next. The Web portal settings page can be skipped: Netlens does not need DSM’s reverse proxy. Press Next, then Done. Container Manager downloads the image and starts the container.
  6. Open http://<nas-address>:8080.

Good to know on a Synology:

  • Port 8080 busy? DSM itself uses 5000 and 5001. If another package already uses 8080, add NETLENS_BIND=0.0.0.0:8081 to the environment: list and open that port instead. With the host network there is no port mapping to set.
  • The data lives in a Docker volume (netlens-data), so there are no folder permissions to set up. If you prefer a shared folder, replace netlens-data:/data with /volume1/docker/netlens-data:/data and give the user 10001 read and write permission on that folder (File Station → folder → Properties → Permission), otherwise Netlens cannot save its data.
  • Firewall: if the DSM firewall is on, allow TCP 8080 from your LAN.
  • To check the settings: Container Manager → Container → netlens → Details shows the network (host); the capabilities are in the project file. Or from SSH: sudo docker inspect netlens --format '{{.HostConfig.NetworkMode}} {{.HostConfig.CapAdd}}'.
  • To update later: Project → netlens → Action → Build (it pulls the newest image), then start it again.
  • To change the file: Project → netlens → Action → Stop, then Edit the compose file (the capabilities are the cap_add: lines), save and Build again. A container that already runs never picks up new capabilities until it is re-created like this.
  • Scans fail with dnet: Failed to open device? That is the ext4 volume case: see Synology: scans fail on an ext4 volume (aufs).
  • Older DSM with the Docker package: if it has Project, use the same file. Without it, the container wizard’s Enable high privilege switch is the only way to get raw network access; it works, but prefer upgrading to Container Manager.