Run as container

Docker

By docker command

Replaced the BOATSWAIN_TOKEN with the one shown in your Boatswain account.

docker run --name boatswain \
  -e "BOATSWAIN_TOKEN=<TO_BE_REPLACED>" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --pid host \
  --network host \
  --cap-add NET_ADMIN \
  --restart always \
  -d boatswainio/boatswain:latest boatswain

By docker compose

Create the following docker-compose.yml and fill in the BOATSWAIN_TOKEN.

version: '3.2'
services:
  boatswain:
    image: boatswainio/boatswain:latest
    container_name: boatswain
    command: boatswain
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    pid: "host"
    network_mode: "host"
    cap_add:
      - NET_ADMIN
    restart: always
    environment:
      BOATSWAIN_TOKEN: <TO_BE_REPLACED>

Limitation when running Boatswain as container

The Disk Utilization graph in the Host Status page could not show the correct values.