Skip to content

Commit aa429cd

Browse files
committed
feat: update the Docker command in the docs
as per the suggestion netbirdio/netbird#2290 (comment)
1 parent 030284f commit aa429cd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/pages/how-to/examples.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,22 @@ You would need to obtain a [setup key](/how-to/register-machines-using-setup-key
104104

105105
The setup key could be found in the NetBird Management dashboard under the Setup Keys tab - [https://app.netbird.io/setup-keys](https://app.netbird.io/setup-keys).
106106

107-
Set the ```NB_SETUP_KEY``` environment variable and run the command.
107+
Set the environment variables:
108+
109+
- `PEER_NAME` - Peer's name and hostname as appearing in the Dashboard/DNS queries
110+
- `NB_SETUP_KEY`
111+
- `EXTERNAL_INTERFACE` - an external interface, the machine uses for Internet access
112+
113+
and run the command:
108114

109115
```bash
110-
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
116+
docker run --rm -d --name "$PEER_NAME" --hostname "$PEER_NAME" --cap-add=NET_ADMIN --cap-add=NET_RAW --cap-add=CAP_BPF -e NB_SETUP_KEY="$NB_SETUP_KEY" -v netbird-client:"/etc/netbird" --sysctl "net.ipv4.conf.all.src_valid_mark=1" --sysctl "net.ipv4.conf.all.rp_filter=2" --sysctl "net.ipv4.conf.${EXTERNAL_INTERFACE}.rp_filter=2" netbirdio/netbird:latest
111117
```
112118

119+
<Note>
120+
`--cap-add=CAP_BPF` was introduced with kernel version `5.8`, you might want to replace it with `--cap-add=CAP_SYS_ADMIN` when running older kernel.
121+
</Note>
122+
113123
That is it! Enjoy using NetBird.
114124

115125
If you would like to learn how to run NetBird Client as an ECS agent on AWS, please refer to [this guide](#net-bird-client-on-aws-ecs-terraform).

0 commit comments

Comments
 (0)