Quick Start
Run NetBird in a Docker container:Docker Images
NetBird provides two Docker images:Standard Image
Image:
netbirdio/netbird:latest- Requires
NET_ADMIN,SYS_ADMIN, andSYS_RESOURCEcapabilities - Uses kernel WireGuard for better performance
- Full feature set
Rootless Image
Image:
netbirdio/netbird:latest-rootless- Runs as non-root user
- Uses userspace WireGuard (netstack)
- DNS disabled by default
- Suitable for restricted environments
Installation
Standard Container
- With Setup Key
- With Management URL
- Interactive Login
Rootless Container
For environments where elevated privileges are not available:The rootless image:
- Uses userspace WireGuard (slower than kernel WireGuard)
- Has DNS disabled by default (
NB_DISABLE_DNS=true) - Stores config in
/var/lib/netbirdinstead of/etc/netbird - Runs as user
netbird(non-root)
Docker Compose
Add NetBird to yourdocker-compose.yml:
Environment Variables
Configure NetBird using environment variables:Common Variables
Daemon Configuration
Entrypoint Timing
Rootless-Specific Variables
Advanced Configuration
Required Capabilities
Standard Image
The standard NetBird image requires these Linux capabilities:NET_ADMIN: Create and manage network interfaces (WireGuard)SYS_ADMIN: Mount and manage network namespacesSYS_RESOURCE: Adjust resource limits for WireGuard
--privileged unless absolutely necessary. The capabilities above are sufficient.
Rootless Image
The rootless image requires no special capabilities but has limited functionality:- Uses userspace WireGuard (lower performance)
- Cannot manage system DNS settings
- Cannot create kernel network interfaces
Networking Considerations
Host Network Mode
For optimal performance, consider using host networking:Custom Bridge Network
Connect NetBird to a custom Docker network:Exposing Ports
If you need to expose specific ports from the container:Volume Management
Persistent Storage
NetBird needs persistent storage for configuration and state:Backing Up Configuration
Checking Container Status
Advanced Use Cases
Kubernetes/K8s
Run NetBird as a sidecar or DaemonSet in Kubernetes:CI/CD Pipelines
Use NetBird in CI/CD to access private resources:Multi-Container Setup
Share NetBird network with other containers:Troubleshooting
Container fails to start
Container fails to start
Check if required capabilities are added:Verify setup key is set:
Cannot connect to peers
Cannot connect to peers
Check container logs:Verify NetBird status:Check WireGuard interface:
DNS not working
DNS not working
For standard image, check DNS configuration:For rootless image, DNS is disabled by default. Enable with:
Permission denied errors
Permission denied errors
Ensure required capabilities are added:For rootless environments, use the rootless image:
Enable Debug Logging
Best Practices
Use Named Volumes
Store configuration in named Docker volumes for easy backup and portability.
Set Restart Policy
Use
--restart unless-stopped to ensure NetBird survives container restarts.Use Environment Variables
Store sensitive data like setup keys in
.env files or secrets managers.Monitor Logs
Regularly check logs for connection issues or errors.