Skip to main content

Docker

Image: lavrushin/b4 on Docker Hub.

docker-compose

Create a docker-compose.yml file:

services:
b4:
image: lavrushin/b4:latest
container_name: b4
network_mode: host
cap_add:
- NET_ADMIN
- NET_RAW
- SYS_MODULE
volumes:
- ./config:/etc/b4
restart: unless-stopped

Run:

mkdir -p config
docker compose up -d

docker run

mkdir -p config
docker run -d \
--name b4 \
--network host \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
--cap-add SYS_MODULE \
-v ./config:/etc/b4 \
--restart unless-stopped \
lavrushin/b4:latest

Parameters

ParameterPurpose
network_mode: hostb4 works with the host network stack directly
NET_ADMINmanage netfilter and firewall rules
NET_RAWuse raw sockets
SYS_MODULEload kernel modules (modprobe)
-v ./config:/etc/b4configuration is stored on the host

Management

docker compose logs -f b4     # logs
docker compose restart b4 # restart
docker compose down # stop
docker compose pull && docker compose up -d # update

Web interface

After startup: http://localhost:7000

The port is configured in config/b4.json (web_server.port).