How to set Wireguard to a fixed Port via DOCKER ENV? #2166

Open
opened 2025-11-20 07:05:04 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @robertpenz on GitHub (Aug 11, 2025).

Running Netbird via Docker on a Mikrotik Router I need to set the WireGuard Port to a fixed value so the p2p traffic from other clients go directly to the container without a relay - as the perimeter firewall blocks it otherwise .

Via CLI its netbird up --wireguard-port 51821 but for DOCKER I can't find a ENV variable, I tried NB_WIREGUARD_PORT but that does not work.

The biggest problem is that the ports are random and not as in iface.go DefaultWgPort = 51820.

Originally created by @robertpenz on GitHub (Aug 11, 2025). Running Netbird via Docker on a Mikrotik Router I need to set the WireGuard Port to a fixed value so the p2p traffic from other clients go directly to the container without a relay - as the perimeter firewall blocks it otherwise . Via CLI its netbird up --wireguard-port 51821 but for DOCKER I can't find a ENV variable, I tried NB_WIREGUARD_PORT but that does not work. The biggest problem is that the ports are random and not as in iface.go DefaultWgPort = 51820.
saavagebueno added the triage-needed label 2025-11-20 07:05:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2166