Docker Installation
The NetBird client (agent) allows a peer to join a pre-existing NetBird deployment. If a NetBird deployment is not yet available, there are both managed and self-hosted options available.
Docker Run Command
Set the NB_SETUP_KEY
environment variable and run the command.
You can pass other settings as environment variables. See Environment variables for details.
NetBird makes use of eBPF and raw sockets, therefore to guarantee the client software functionality, we recommend adding the flags --cap-add=SYS_ADMIN
and --cap-add=SYS_RESOURCE
for docker clients.
The experience may vary depending on the docker daemon, operating system, or kernel version.
docker run --rm --name PEER_NAME --hostname PEER_NAME --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --cap-add=SYS_RESOURCE -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:latest
See Docker example for details.
Troubleshooting
-
If you are using self-hosted version and haven't specified
--management-url
, the client app will use the default URL which ishttps://api.wiretrustee.com:33073
. -
If you have specified a wrong
--management-url
(e.g., just by mistake when self-hosting) to override it you can do the following:
netbird down
netbird up --management-url https://<CORRECT HOST:PORT>/
To override it see the solution #1 above.
Docker Compose
If you prefer to run NetBird as a Docker compose stack below is an example. Configure to your specific needs.
services:
netbird:
container_name: netbird
hostname: <HOSTNAME>
cap_add:
- NET_ADMIN
- SYS_ADMIN
- SYS_RESOURCE
network_mode: host
environment:
- NB_SETUP_KEY=<SETUP KEY>
volumes:
- netbird-client:/etc/netbird
image: netbirdio/netbird:latest
volumes:
netbird-client:
name: netbird-client
Running NetBird with a Setup Key
In case you are activating a server peer, you can use a setup key as described in the steps below.
This is especially helpful when you are running multiple server instances with infrastructure-as-code tools like ansible and terraform.
- Login to the Management Service. You need to have a
setup key
in hand (see setup keys).
docker run --network host --privileged --rm -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/etc/netbird netbirdio/netbird:<TAG>
TAG > 0.6.0 version
You could also omit the
--setup-key
property. In this case, the tool will prompt for the key.
- Check connection status:
netbird status
- Check your IP:
sudo ifconfig utun100