Skip to content

Configuration reference

Every flag and environment variable that Bield, its install script and its agent read. What admins change in the app is on the Settings page.

bield serve Run the Bield hub
bield admin Add, remove and list admins and viewers
bield backup Save a copy of Bield's data
bield healthcheck Check that a running Bield answers (for Docker)
bield version Print the version

bield <command> -h prints a command’s flags. Bield writes its log to standard error, as text. There’s no log level to set.

A flag wins over its environment variable, and the variable wins over the default. An empty variable counts as unset. A malformed BIELD_PORT only fails the start if --port doesn’t replace it.

FlagEnvironment variableDefaultWhat it does
--tailscaleBIELD_TAILSCALEembeddedHow Bield joins the tailnet. embedded runs a node of its own inside Bield. host uses the tailscaled on this machine. See Bield and Tailscale.
--hostnameBIELD_HOSTNAMEbieldThe name of Bield’s node on the tailnet, and the first part of its MagicDNS name. Embedded mode only.
--control-urlBIELD_CONTROL_URLTailscale’sThe control server that the embedded node logs in to, such as a Headscale server. It has to be an http:// or https:// address with a host and maybe a port, and no path. Bield refuses it in host mode, where tailscale up --login-server decides.
--setup-listenBIELD_SETUP_LISTEN127.0.0.1:4700Where the login page listens in embedded mode. It shows the login link until the node is on the tailnet, and a link to Bield after. Keep it on loopback, or anyone who reaches it can add Bield to their own tailnet.
--portBIELD_PORT4700The port Bield serves on in host mode, on each of the machine’s tailnet IPs. Embedded mode always uses 443 (80 without HTTPS).
--data-dirBIELD_DATA_DIR~/.config/bieldWhere Bield keeps its data, listed under the data directory. The default is bield in the user’s config directory, which is $XDG_CONFIG_HOME if it’s set, and ~/Library/Application Support on macOS.
--host-rootBIELD_HOST_ROOT/The directory whose proc/ and sys/ Bield measures its machine from. Only for a container that mounts the host’s under another path, such as /host. See Docker.
--adminsBIELD_ADMINSnoneLogins to make Bield’s first admins, separated by commas, along with the owner of Bield’s node. Bield reads it only while it has no admins. See Admins and viewers.
--demoBIELD_DEMOoffRun against a made-up tailnet. Takes true or false. See Demo mode.
--demo-listenBIELD_DEMO_LISTEN127.0.0.1:4700Where the demo is served.
--demo-devicesBIELD_DEMO_DEVICES12How many machines the demo has, from 2 to 1000.
--demo-daysBIELD_DEMO_DAYS7Days of history the demo starts with, above 0 and up to 90.
--dev-uiBIELD_DEV_UInoneThe address of a Vite dev server to proxy the web app to. For working on Bield, and only admins get it. make dev sets it.

The Docker image sets BIELD_DATA_DIR=/data, and the install script sets it to /var/lib/bield.

CommandFlagEnvironment variableWhat it does
bield admin--data-dirBIELD_DATA_DIRWhere the database is. It works while Bield is running.
bield backup--data-dirBIELD_DATA_DIRWhere the data is.
bield healthcheck--setup-listenBIELD_SETUP_LISTENThe login page’s address, as bield serve got it.

The subcommands of bield admin are in Admins and viewers, and bield backup is in Upgrading, backups and rolling back.

Variables that Tailscale and the system read

Section titled “Variables that Tailscale and the system read”

These aren’t Bield’s, but Bield’s behavior depends on them.

VariableWhat it does
TS_AUTHKEY (or TS_AUTH_KEY)An auth key or a Headscale pre-auth key. The embedded node uses it to log in without a link, but only while it has no saved node. After that, the variable does nothing, so it can go.
TS_CONTROL_URLThe control server of the embedded node, if --control-url isn’t set.
TS_NO_LOGS_NO_SUPPORTSet to true to stop the embedded node from uploading its logs to Tailscale.
DOCKER_HOSTWhere Bield finds Docker on the machine it runs on. Only unix:// addresses work. The default is /var/run/docker.sock.
XDG_RUNTIME_DIRWhere Bield finds the systemd session of the user it runs as, to watch that user’s units. Without a session bus there, Bield watches system units only.
PathWhat it holds
bield.db, bield.db-wal, bield.db-shmThe database: settings, roles, history, alerts, the activity log, and the secrets of notification channels.
bield.db.bakThe database as it was before the last upgrade that changed it.
tailscale/The embedded node’s identity.
ssh/id_ed25519Bield’s SSH key.
backups/Backups that the install script saves before an upgrade.

If the directory doesn’t exist, Bield creates it so that only its own user can read it. It holds keys and secrets, so keep it that way. See Upgrading, backups and rolling back.

install.sh reads these from its environment. Put them after sudo, which drops any that come before it. Bield’s own settings from the list are saved in /etc/bield/bield.env the first time, and any other bield serve variable can go in that file too, one NAME=value per line. The script refuses values with spaces, quotes, backslashes or $, and systemd’s rules for environment files apply to anything you add by hand.

VariableWhat it does
BIELD_VERSIONThe release to install, such as v0.1.0. The default is the latest.
BIELD_TAILSCALEembedded (the default) or host.
BIELD_HOSTNAMEThe name of Bield’s node, in embedded mode.
BIELD_CONTROL_URLThe address of a Headscale server, in embedded mode.
BIELD_ADMINSLogins to make the first admins.
TS_AUTHKEYAn auth key, so Bield joins the tailnet without a login.
BIELD_RELEASES_URLWhere releases are downloaded from, if you mirror them. The default is the project’s GitHub releases. Not saved in bield.env.

More in Installing Bield.

The agent reads a file of NAME=value lines, which ~/.config/bield-agent/env is unless BIELD_AGENT_CONF names another path. The install command writes it, so you rarely edit it. See The agent.

SettingDefaultWhat it does
SERVER_URLnoneBield’s address, such as https://bield.example.ts.net. Required.
SECRETnoneThe agent’s own secret, which it got when it enrolled. Required, and kept in a file only its user can read.
INTERVAL15Seconds between heartbeats.
VariableWhat it does
BIELD_DEV_UISee --dev-ui above.
BIELD_LOAD_DEVICES, BIELD_LOAD_DAYS, BIELD_LOAD_SECONDSHow many devices (200) and days of history (7) make load runs Bield with, and how many seconds (30) it measures. See Benchmarks.