Skip to content

Environment variables

Every config field has an environment-variable equivalent. This is the recommended way to configure the agent in Docker. Env vars win over YAML, and you don’t have to mount and edit a config file inside the container.

VariableDefaultDescription
LOG_LEVELinfoLog verbosity: debug, info, warn (or warning), error. Case-insensitive. Unrecognised value fails startup.
DATA_DIR/var/lib/atreoagentPersistent data directory.
WG_PORT51820WireGuard UDP listen port.
WG_FIREWALL_ENABLEDtrueConfine tunnel peers to the proxy ports plus any granted exposed-port app ports, on both IPv4 and IPv6. Fails closed: if iptables/ip6tables is unavailable or the rules can’t be applied, the agent refuses to start. Set false only if you genuinely can’t run them (exposes every 0.0.0.0/::-bound host port to every paired peer; discouraged).
WG_UPNP_ENABLEDtrueMaster switch for automatic inbound-port opening (PCP, NAT-PMP, UPnP, and the IPv6 firewall pinhole). If disabled or unsupported, set up a manual port forward instead.
WG_PCP_ENABLEDtrueTry PCP (RFC 6887) first when opening the port, for both IPv4 and IPv6. Set false to skip PCP and use only NAT-PMP/UPnP. Accepts true/false/1/0.
WG_IPV6_PINHOLE_ENABLEDtrueOpen an IPv6 firewall pinhole for the WireGuard port so the AAAA endpoint is reachable. Set false to manage the gateway firewall manually. Accepts true/false/1/0.
ENDPOINT_IP(auto-detected)Public IP override. Normally unset; atreoLINK detects your IP from the agent’s connection.
ENDPOINT_PORT(auto-detected)Public port override.
RELAY_ENABLEDtrueUse the CGNAT relay as a fallback when the agent has no reachable public inbound path. Automatic and fallback-only — direct paths always win. Set false to opt this agent out of relaying entirely.
RELAY_FORCEfalseKeep a relay session up even when a direct path exists, so a relay endpoint is always available to hand to clients (clients still prefer LAN/direct). Useful for offering a relay config alongside a direct one; not needed for normal use.
PROXY_ENABLEDtrueEnable the built-in HTTPS reverse proxy.
PROXY_HTTP_PORT80HTTP port.
PROXY_HTTPS_PORT443HTTPS port.
PROXY_AUTH_PORT9091Forward-auth endpoint port.
PROXY_TRUSTED_PROXIES(empty)Comma-separated CIDRs of external proxies allowed to set X-Forwarded-For / X-Forwarded-Host. See Forward auth.
NOTIFY_PORT9876Notification API port.
SMTP_ENABLEDfalseEnable the built-in SMTP server.
SMTP_LISTEN0.0.0.0:2525SMTP bind address.
SMTP_CATCH_ALL(empty)Fallback recipient for mail whose RCPT TO matches no member. Must be an existing member’s atreoLINK email; if it isn’t a member, unknown mail is still rejected and a warning is logged. Empty (default) rejects unknown recipients with 550. See Catch-all recipient.
SMTP_MAX_MESSAGE_BYTES1048576Max accepted SMTP message size in bytes.
SMTP_RATE_PER_MINUTE50Per-source-IP SMTP rate limit.
SMTP_TLS_ENABLEDfalseAdvertise STARTTLS using a self-signed cert (TLS 1.3). See STARTTLS.
SMTP_TRUSTED_NETWORKSloopback + RFC1918 + link-local + ULA + tunnel subnetComma-separated CIDRs allowed to connect to the SMTP gateway. Source IPs outside the list are rejected before AUTH. See Source-IP allowlist for the full default list.
services:
atreoagent:
image: ghcr.io/atreolabs/atreoagent:latest
container_name: atreoagent
restart: unless-stopped
network_mode: host
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
environment:
- PROXY_ENABLED=false # Use your own reverse proxy
- WG_PORT=51821 # Custom WireGuard port
- ENDPOINT_IP=203.0.113.10 # Static public IP
- ENDPOINT_PORT=51821 # Static public port
- SMTP_ENABLED=true # Enable LAN SMTP gateway
- SMTP_LISTEN=192.168.1.10:2525 # Bind to LAN only
volumes:
- ./agent-data:/var/lib/atreoagent

atreoLINK detects your public IP from the agent’s authenticated connection and keeps the DDNS record current. If your router has no UPnP/NAT-PMP (or you turn it off), forward the WireGuard UDP port manually; the tunnel works as soon as the port is reachable:

Terminal window
WG_UPNP_ENABLED=false # optional: stop the agent attempting auto port-mapping

See Manual port forwarding for the full walkthrough.

The built-in SMTP server lets self-hosted apps that only support email notifications deliver them through atreoLINK as encrypted push notifications. Off by default. See Built-in SMTP server.

Terminal window
SMTP_ENABLED=true
SMTP_LISTEN=192.168.1.10:2525

Resolution order, later wins:

  1. Built-in defaults.
  2. Values in config.yaml (if the file exists).
  3. Environment variables.

The config file remains the source of pairing-derived data (device_token, device_id, apps_hostname). Env vars are for tunables, not pairing data.

WireGuard is a registered trademark of Jason A. Donenfeld.