Run a node

Run with Docker

Start the node yourself, with the Docker command line or with Compose.

On this page

Use these commands when you manage your containers directly. Both build hopbits/agent:local from https://hopbits.io/releases/Dockerfile, which verifies the Linux release binary against SHA256SUMS and packages it on a non-root distroless base image without needing any registry login.

Docker CLI
sudo docker build -t hopbits/agent:local https://hopbits.io/releases/Dockerfile
sudo docker volume create hopbits-data

sudo docker run -d \
  --name hopbits-agent \
  --restart=always \
  --cap-drop ALL \
  --security-opt no-new-privileges:true \
  --network host \
  -e HOPBITS_NETWORK_MODE=host \
  -v hopbits-data:/var/lib/hopbits \
  hopbits/agent:local

sudo docker logs -f hopbits-agent

Then read the pairing code from the log and pair the node.

Host or bridge

The node can use the host's network or Docker's bridge network. Host is the default.

HostBridge
Docker flag--network host--network bridge
SettingHOPBITS_NETWORK_MODE=hostHOPBITS_NETWORK_MODE=bridge
Ping checksNeed one setting on the hostNeed one setting on the container
IPv6 targetsAllowedOnly when the gateway sees a public IPv6 address for the node

Bridge mode

The --sysctl line lets the container send pings without extra privileges.

Docker CLI
sudo docker build -t hopbits/agent:local https://hopbits.io/releases/Dockerfile
sudo docker volume create hopbits-data

sudo docker run -d \
  --name hopbits-agent \
  --restart=always \
  --cap-drop ALL \
  --security-opt no-new-privileges:true \
  --network bridge \
  --sysctl net.ipv4.ping_group_range="0 2147483647" \
  -e HOPBITS_NETWORK_MODE=bridge \
  -v hopbits-data:/var/lib/hopbits \
  hopbits/agent:local

Ping checks in host mode

With its capabilities dropped, a container on the host's network can only ping if the host allows unprivileged ping sockets:

Linux shell
sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"

Without it the node still runs HTTP and TCP checks. It simply does not offer ping. To keep the setting after a reboot, put the same line in a file under /etc/sysctl.d/.