Skip to content

Environment Variables

List values should be comma separated with no spaces. For example: SENSORS=sensor_1,sensor_2.

Hub

Environment variables may optionally be prefixed with BESZEL_HUB_.

NameDefaultDescription
APP_URLunsetURL of the web UI. Must set if serving on a subpath.
CSPunsetAdds a Content-Security-Policy header with this value.
DISABLE_PASSWORD_AUTHfalseDisables password authentication.
SHARE_ALL_SYSTEMSfalseAllows access to all systems by all users.
USER_CREATIONfalseEnables automatic user creation for OAuth2 / OIDC.

DISABLE_PASSWORD_AUTH

This does not disable authentication entirely. It disables password login if you want to use OAuth instead.

SHARE_ALL_SYSTEMS

If true, systems will be visible to all users. Users can also edit or delete any system unless they are assigned the readonly role.

Agent

Environment variables may optionally be prefixed with BESZEL_AGENT_.

NameDefaultDescription
DOCKER_HOSTunsetOverrides the docker host (docker.sock) if using a proxy.
EXTRA_FILESYSTEMSunsetMonitor extra disks if using binary. See Additional Disks.
FILESYSTEMunsetDevice, partition, or mount point to use for root disk stats.
KEYunsetPublic SSH key(s) to use for authentication. Provided in hub.
KEY_FILEunsetRead public keys from a file instead of an environment variable.
LISTEN45876Port or host:port to listen on.
LOG_LEVELinfoLogging level. Valid values: "debug", "info", "warn", "error".
MEM_CALCunsetOverrides the default memory calculation.
NETWORKunsetNetwork for listener. "tcp", "tcp4", "tcp6", or "unix".
NICSunsetWhitelist of network interfaces to monitor for bandwidth.
PRIMARY_SENSORunsetDisplay specific temperature sensor in 'All Systems' table.
SENSORSunsetWhitelist of temperature sensors to monitor.
SYS_SENSORSunsetOverrides sys path for sensors. See #160.

LISTEN

The host must be a literal IP address or full path to a unix socket. If it is an IPv6 address it must be enclosed in square brackets, as in [2001:db8::1]:45876.

DOCKER_HOST

Beszel only needs access to read container information. For linuxserver/docker-socket-proxy you would set CONTAINERS=1.

KEY / KEY_FILE

Multiple keys can be provided if they are separated by newlines. You can also leave comments by starting the line with #.

NETWORK

Default depends on the address value. If the address starts with /, it is treated as a unix socket. Otherwise, tcp is used.

MEM_CALC

The default value for used memory is based on gopsutil's Used calculation, which should align fairly closely with free. Set MEM_CALC to htop to align with htop's calculation.

PRIMARY_SENSOR

The highest temperature will be used if a specific sensor is not defined.

SENSORS

Set to an empty string (SENSORS="") to disable temperature monitoring.

Deprecations

These variables are deprecated but will remain for backward compatibility.

NameDefaultDescription
PORT45876Renamed to LISTEN.

Setting environment variables

Docker

For Docker Compose, use the environment or env_file attributes in docker-compose.yml (instructions).

For docker run, use the -e, --env, or --env-file flags (instructions).

Binary

If executing the binary directly, include the environment variables as command line arguments. For example: MEM_CALC=htop ./beszel-agent.

If using Systemd, the service configuration is usually located in /etc/systemd/system/beszel-agent.service. Edit env vars in the [Service] section, either directly with Environment="KEY=VALUE" or with an env file defined in EnvironmentFile=PATH.

Alternatively, you can create an override file for your modifications with systemctl edit beszel or systemctl edit beszel-agent (instructions).

After editing the service, reload the configuration and restart:

bash
sudo systemctl daemon-reload
sudo systemctl restart beszel-agent # or beszel for the hub

Released under the MIT License