docker/container requirements #360

Closed
opened 2025-11-20 05:10:10 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @lfarkas on GitHub (Jun 5, 2023).

in the docs there are 2 different docker command line:
docker run --network host --privileged --rm -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:<TAG>
and the other is:
docker run --rm --name PEER_NAME --hostname PEER_NAME --cap-add=NET_ADMIN -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:latest
there are a few problem with this docs:

  • why not use the same cmd line args in all case eg: --rm, --hostname, --name
  • why use --privileged in the other case --cap-add=NET_ADMIN
  • why use <TAG> and the other case latest

BUT the biggest problem is the totally inconsistent usage of required capabilities. in another page:
https://docs.netbird.io/how-to/examples#net-bird-client-in-docker use only --cap-add=NET_ADMIN for setup-key too.

Of course using the --privileged is the easiest way but probably not the most professional ones.
I debug netbird for a few hours and find the out the the real capabilities requirements are:

  • NET_ADMIN
  • NET_RAW
  • BPF

and AFAIS the

  • SYS_ADMIN is not required but does it true?
  • SYS_MODULE is required? if the kernel module not already loaded?
  • SYS_RAWIO is required?

it'd be useful if someone who is in charge can confirm it.
and then all docs can be updated.

Another good question does netbird use the /dev/net/tun device when running in a docker container? other wireguard based solution use tun device kernel interface.

Originally created by @lfarkas on GitHub (Jun 5, 2023). in the [docs](https://docs.netbird.io/how-to/getting-started#running-net-bird-in-docker) there are 2 different docker command line: `docker run --network host --privileged --rm -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:<TAG>` and the other is: `docker run --rm --name PEER_NAME --hostname PEER_NAME --cap-add=NET_ADMIN -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:latest` there are a few problem with this docs: - why not use the same cmd line args in all case eg: --rm, --hostname, --name - why use `--privileged` in the other case `--cap-add=NET_ADMIN` - why use `<TAG>` and the other case `latest` BUT the biggest problem is the totally inconsistent usage of required capabilities. in another page: https://docs.netbird.io/how-to/examples#net-bird-client-in-docker use only `--cap-add=NET_ADMIN` for setup-key too. Of course using the `--privileged` is the easiest way but probably not the most professional ones. I debug netbird for a few hours and find the out the the real capabilities requirements are: - NET_ADMIN - NET_RAW - BPF and AFAIS the - SYS_ADMIN is not required but does it true? - SYS_MODULE is required? if the kernel module not already loaded? - SYS_RAWIO is required? it'd be useful if someone who is in charge can confirm it. and then all docs can be updated. Another good question does netbird use the /dev/net/tun device when running in a docker container? other wireguard based solution use tun device kernel interface.
saavagebueno added the bugclient labels 2025-11-20 05:10:10 -05:00
Author
Owner

@lfarkas commented on GitHub (Aug 2, 2023):

imho currenlty these are the requirements:

  • SYS_ADMIN
  • SYS_RESOURCE
  • NET_ADMIN
  • NET_RAW
  • BPF
@lfarkas commented on GitHub (Aug 2, 2023): imho currenlty these are the requirements: - SYS_ADMIN - SYS_RESOURCE - NET_ADMIN - NET_RAW - BPF
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#360