Configuration Reference

Complete reference for all ServerBee server and agent configuration options.

ServerBee loads configuration with Figment, which layers values from multiple sources. This page is a complete reference for every configuration option.

Configuration Loading Priority

Server values are merged in this order, with later sources overriding earlier ones:

  1. Built-in defaults
  2. /etc/serverbee/server.toml
  3. /opt/serverbee/etc/server.toml (the path used by the install script)
  4. server.toml in the working directory
  5. Environment variables prefixed with SERVERBEE_

The Agent uses built-in defaults, then /etc/serverbee/agent.toml, agent.toml in its working directory, and finally SERVERBEE_ environment variables. The managed service uses /opt/serverbee/etc as its working directory, so its third source is /opt/serverbee/etc/agent.toml.

This lets you override effective settings at runtime without editing the TOML file. Compatibility-only fields, such as the Agent's collector.interval, are called out below.

Environment Variable Mapping

Every TOML key maps directly to an environment variable: add the SERVERBEE_ prefix, uppercase the key, and replace each level of nesting with __ (double underscore). For example, auth.secure_cookie becomes SERVERBEE_AUTH__SECURE_COOKIE.

Developer Workflow Env Vars

These variables drive local repo tooling and developer workflows. They are not Figment-backed runtime config for the server or agent binaries.

Environment VariableUsed ByDescription
SERVERBEE_PROD_URLmake db-pull, make web-dev-prodProduction base URL used by the database pull script and the frontend prod-proxy workflow
SERVERBEE_PROD_API_KEYmake db-pullAdmin-scoped API key for the production backup API. Do not reuse this for make web-dev-prod
SERVERBEE_PROD_READONLY_API_KEYmake web-dev-prodMember-scoped API key injected by the frontend dev proxy for live production browsing
ALLOW_WRITESmake web-dev-prodLocal opt-in override. Set to 1 to disable the proxy's read-method-only block. When set, the UI banner changes from the normal read-only warning to a stronger write-enabled warning

These variables are intentionally scoped to local tooling. ALLOW_WRITES is not a server feature flag; it is an explicit local override for the frontend prod-proxy workflow only.

Server Environment Variables

Quick Start

There is no admin username/password environment variable. On first start (when no users exist) the server auto-creates an admin account with a randomly generated password and prints it once to the server/container logs as a highlighted credentials banner. Capture it from the logs, then on first login you are required to change this password and may optionally choose a different username.

Environment VariableDefaultDescription
SERVERBEE_SERVER__LISTEN0.0.0.0:9527Listen address and port

Common

Environment VariableDefaultDescription
SERVERBEE_SERVER__DATA_DIR./dataData directory for database and backups
SERVERBEE_AUTH__MAX_SERVERS0Maximum servers allowed via enrollment (0 = no limit). Best-effort soft cap
SERVERBEE_SERVER__TRUSTED_PROXIESprivate/loopback CIDRsCIDR list of trusted reverse proxies. Defaults to RFC 1918 + loopback. Set to [] to disable
SERVERBEE_SCHEDULER__TIMEZONEUTCTimezone for daily traffic aggregation (e.g. Asia/Shanghai)
SERVERBEE_LOG__LEVELinfoLog level: trace, debug, info, warn, error
SERVERBEE_LOG__FILE""Log file path. Empty means stdout only

Development Only

Environment VariableDefaultDescription
SERVERBEE_DEV__DEMO_DATAfalseReset and seed the local synthetic demo dataset. Only allowed with SERVERBEE_DATABASE__PATH=dev-demo.db; creates admin / admin123 and in-memory demo agents for local development

OAuth (Optional)

Environment VariableDefaultDescription
SERVERBEE_OAUTH__BASE_URL""Public server URL for constructing OAuth callback URLs
SERVERBEE_OAUTH__ALLOW_REGISTRATIONfalseAuto-create user accounts on first OAuth login
SERVERBEE_OAUTH__GITHUB__CLIENT_ID--GitHub OAuth App client ID
SERVERBEE_OAUTH__GITHUB__CLIENT_SECRET--GitHub OAuth App client secret
SERVERBEE_OAUTH__GOOGLE__CLIENT_ID--Google OAuth client ID
SERVERBEE_OAUTH__GOOGLE__CLIENT_SECRET--Google OAuth client secret
SERVERBEE_OAUTH__OIDC__ISSUER_URL--OIDC provider issuer URL
SERVERBEE_OAUTH__OIDC__CLIENT_ID--OIDC client ID
SERVERBEE_OAUTH__OIDC__CLIENT_SECRET--OIDC client secret
SERVERBEE_OAUTH__OIDC__SCOPES["openid", "email", "profile"]OAuth scopes to request

GeoIP (Optional)

Environment VariableDefaultDescription
SERVERBEE_GEOIP__MMDB_PATH""Path to a MaxMind-compatible MMDB file. Non-empty path enables this custom GeoIP database; otherwise admins can download the DB-IP Lite database from Settings → GeoIP Database
SERVERBEE_ASN__MMDB_PATH""Path to a DB-IP Lite ASN / MaxMind GeoLite2-ASN MMDB file. Non-empty path enables traceroute ASN enrichment; otherwise admins can download DB-IP Lite ASN from Settings → ASN Database

Resend (Email Notifications)

Environment VariableDefaultDescription
SERVERBEE_RESEND__API_KEY""Resend API key. Required for Email notifications. Sender domain must be verified at resend.com/domains

Data Retention (Tuning)

Environment VariableDefaultDescription
SERVERBEE_RETENTION__RECORDS_DAYS7Raw metric records retention in days
SERVERBEE_RETENTION__RECORDS_HOURLY_DAYS90Hourly aggregated records retention in days
SERVERBEE_RETENTION__GPU_RECORDS_DAYS7GPU metric records retention in days
SERVERBEE_RETENTION__PING_RECORDS_DAYS7Ping probe records retention in days
SERVERBEE_RETENTION__NETWORK_PROBE_DAYS7Raw network probe records retention in days
SERVERBEE_RETENTION__NETWORK_PROBE_HOURLY_DAYS90Hourly network probe aggregates retention in days
SERVERBEE_RETENTION__AUDIT_LOGS_DAYS180Audit log retention in days
SERVERBEE_RETENTION__TRAFFIC_HOURLY_DAYS7Traffic hourly records retention in days
SERVERBEE_RETENTION__TRAFFIC_DAILY_DAYS400Traffic daily records retention in days
SERVERBEE_RETENTION__TASK_RESULTS_DAYS7Task results retention in days
SERVERBEE_RETENTION__DOCKER_EVENTS_DAYS7Docker event records retention in days
SERVERBEE_RETENTION__SERVICE_MONITOR_DAYS30Service monitor records retention in days
SERVERBEE_RETENTION__SECURITY_EVENT_DAYS30Security event records retention in days
SERVERBEE_RETENTION__IP_QUALITY_EVENT_DAYS90IP quality status-change event records retention in days

Mobile (Optional)

Environment VariableDefaultDescription
SERVERBEE_MOBILE__ACCESS_TTL900Mobile access token lifetime in seconds (15 min)
SERVERBEE_MOBILE__REFRESH_TTL2592000Mobile refresh token lifetime in seconds (30 days)

Firewall (Optional)

Tier-2 guardrail for the Firewall Blocklist feature. CIDRs / IPs listed here are refused by POST /api/firewall/blocks even if an administrator tries to insert them. Tier 1 (hard-coded protected ranges: loopback, RFC 1918, link-local, multicast, unspecified) is always enforced.

Environment VariableDefaultDescription
SERVERBEE_FIREWALL__ALLOW_LIST[]CIDRs / IPs the server refuses to insert into block_list. Tier-2 guardrail layered on top of the hard-coded Tier-1 protected ranges

IP Quality

By default, the Server calls ipapi.is anonymously (100 requests per client IP per UTC day). ServerBee uses the minimal response's proxy, VPN, datacenter, Tor, and abuse flags and derives an IP type, but no numeric risk score. A free account/API key provides 1,000 requests per day and the full response required for the 0–100 score. The Server falls back to ip-api.com only when the primary request fails, including HTTP 429, not when a successful response lacks a score. See IP Quality for details and the fallback's non-commercial/HTTP warning.

Environment VariableDefaultDescription
SERVERBEE_IP_QUALITY__RISK_PROVIDER"ipapi_is"Primary risk provider. One of: none, ipapi_is, ip-api.
SERVERBEE_IP_QUALITY__RISK_PROVIDER_FALLBACK"ip-api"Fallback provider triggered on primary failure. Set to none to disable.
SERVERBEE_IP_QUALITY__IPAPI_IS__API_KEY--Optional. A free account key provides 1,000 requests per day and the full response required for the 0–100 score.
SERVERBEE_IP_QUALITY__IPAPI_IS__ENDPOINT""Override for self-hosted mirrors or testing. Empty falls back to the built-in default https://api.ipapi.is.

Migration from older versions: Earlier releases supported four paid providers (Scamalytics, IPQualityScore, ProxyCheck, AbuseIPDB) configured via SERVERBEE_IP_QUALITY__{SCAMALYTICS,IPQS,PROXYCHECK,ABUSEIPDB}__*. These env vars are silently ignored. To restore equivalent functionality, fork or vendor the provider implementation from a tag prior to 2026-05-25.

Network Probe Anomaly Thresholds

Average-latency cutoffs used to classify network-probe records returned by /api/servers/{id}/network-probes/anomalies and the anomaly_count field on the network-probe overview. Records strictly above very_high_latency_ms are tagged very_high_latency; records above high_latency_ms (and at or below the very-high cutoff) are tagged high_latency.

Environment VariableDefaultDescription
SERVERBEE_NETWORK_PROBE__HIGH_LATENCY_MS500Avg-latency cutoff (ms) for high_latency classification
SERVERBEE_NETWORK_PROBE__VERY_HIGH_LATENCY_MS800Avg-latency cutoff (ms) for very_high_latency classification

Internal

These variables have sensible defaults and rarely need changing. Adjust them only when you have a specific requirement.

Environment VariableDefaultDescription
SERVERBEE_DATABASE__PATHserverbee.dbSQLite database file path (relative to data_dir)
SERVERBEE_DATABASE__MAX_CONNECTIONS10Maximum database connection pool size
SERVERBEE_AUTH__SESSION_TTL86400Session token TTL in seconds (default 24h)
SERVERBEE_AUTH__SECURE_COOKIEtrueSet the Secure flag on session cookies. Use false only when the browser accesses ServerBee over plain HTTP, such as direct IP quick-start installs
SERVERBEE_RATE_LIMIT__LOGIN_MAX5Max login attempts per IP within 15-minute window
SERVERBEE_RATE_LIMIT__REGISTER_MAX10Max agent registrations per IP within 15-minute window. Admins can clear an active window from Settings → Rate limits
SERVERBEE_UPGRADE__RELEASE_BASE_URLhttps://github.com/ZingerLittleBee/ServerBee/releasesBase URL for agent upgrade release assets
SERVERBEE_UPGRADE__LATEST_VERSION_URL""Optional custom URL for latest version API. If empty, uses GitHub API
SERVERBEE_UPGRADE__CHANNELstableRelease channel used by the dashboard version check: stable or beta
SERVERBEE_FILE__MAX_UPLOAD_SIZE104857600Maximum file upload size in bytes (default 100 MB)

Agent Environment Variables

Agent top-level keys use single underscore. Nested keys use __ (double underscore).

Quick Start

Environment VariableDefaultDescription
SERVERBEE_SERVER_URL-- (required)Server HTTP base URL (e.g. http://your-server:9527). Agent appends API paths automatically
SERVERBEE_ENROLLMENT_CODE""One-time enrollment offer shown when a Server is added or re-enrollment begins. Single-use and short-lived (default 10 min). Only used when token is empty

Common

Environment VariableDefaultDescription
SERVERBEE_COLLECTOR__INTERVAL3Compatibility-only field. The Agent currently ignores it and uses the Server's Welcome.report_interval value, which is fixed at 3 seconds
SERVERBEE_COLLECTOR__ENABLE_GPUfalseEnable NVIDIA GPU monitoring (requires a build with the gpu feature and an NVIDIA driver that provides NVML)
SERVERBEE_COLLECTOR__ENABLE_TEMPERATUREtrueEnable CPU temperature monitoring
SERVERBEE_FILE__ENABLEDfalseEnable file management on this agent
SERVERBEE_FILE__ROOT_PATHS[]Allowed root paths (comma-separated, e.g. /home,/var/log). Empty rejects all file operations
SERVERBEE_CAPABILITIES__ALLOW[]Capability keys to enable on top of the default set (CAP_DEFAULT), e.g. ["terminal","file"]. See Capabilities
SERVERBEE_CAPABILITIES__DENY[]Capability keys to strip from the default set. deny wins over allow. Unknown keys fail at startup
SERVERBEE_CAPABILITIES__TEMPORARY_MAX_DURATION24hMax duration a single temporary capability grant can last (e.g. 30m, 2h, 1d). See Capabilities → Temporary grants
SERVERBEE_CAPABILITIES__STATE_DIR/var/lib/serverbeeDirectory where the agent persists capability_grants.json (must be writable by the agent)
SERVERBEE_IP_CHANGE__ENABLEDtrueEnable periodic IP change detection
SERVERBEE_LOG__LEVELinfoLog level: trace, debug, info, warn, error
SERVERBEE_LOG__FILE""Log file path. Empty means stdout only

Internal

These variables have sensible defaults and rarely need changing. Adjust them only when you have a specific requirement.

Environment VariableDefaultDescription
SERVERBEE_TOKENgenerated when emptyAgent run token. During enrollment the Agent generates and persists one before claim; an explicit environment override is used as provided and is not written to disk
SERVERBEE_FILE__MAX_FILE_SIZE1073741824Max file size in bytes for read/download (default 1GB)
SERVERBEE_FILE__DENY_PATTERNS*.key,*.pem,...Glob patterns for files the agent refuses to access
SERVERBEE_IP_CHANGE__EXTERNAL_IP_URLS["https://api.ipify.org","https://ifconfig.me/ip","https://icanhazip.com","https://checkip.amazonaws.com"]Ordered list of public IP services tried at startup and on every IP-change tick. First success wins. Required for agents behind NAT or in containers where interface enumeration can't see the routable IP. Set to [] to skip external lookups for air-gapped deployments
SERVERBEE_IP_CHANGE__INTERVAL_SECS300IP check interval in seconds (default 5 minutes)

Upgrade (Agent)

Environment VariableDefaultDescription
SERVERBEE_UPGRADE__RELEASE_REPO_URLhttps://github.com/ZingerLittleBee/ServerBee/releasesPinned release source base URL the Agent downloads upgrades from. Any HTTPS host mirroring the GitHub releases path layout {base}/download/v{version}/{asset} and {base}/download/v{version}/sha256sums.txt works. Compile-time default is overridable via the SERVERBEE_RELEASE_REPO build-time env
SERVERBEE_UPGRADE__RELEASE_CERT_SPKI_SHA256""Optional TLS certificate SPKI pin for the release host. 64 lowercase hex chars = SHA-256 of the leaf cert SubjectPublicKeyInfo DER. Empty = disabled. If set, the Agent additionally pins the leaf cert SPKI after standard chain validation. Invalid (non-64/non-hex) values are rejected at startup

Security (Agent)

Tunes the agent-side security event detectors (SSH login / brute force, port scan). Detection runs entirely on the agent; the server only stores events and evaluates alert rules. Configure per-host since traffic profiles differ.

Environment VariableDefaultDescription
SERVERBEE_SECURITY__ENABLEDtrueMaster switch for all security detectors. When false the agent emits no security_event messages
SERVERBEE_SECURITY__SSH__WINDOW_SECONDS60Sliding window length (seconds) for SSH brute-force detection
SERVERBEE_SECURITY__SSH__FAILED_THRESHOLD10Failed SSH attempts within the window that trigger an ssh_brute_force event. Queue clears after firing
SERVERBEE_SECURITY__PORT_SCAN__ENABLEDfalseEnable port-scan detection. Requires conntrack CLI installed (Linux)
SERVERBEE_SECURITY__PORT_SCAN__WINDOW_SECONDS30Sliding window length (seconds) for port-scan detection
SERVERBEE_SECURITY__PORT_SCAN__DISTINCT_PORT_THRESHOLD20Distinct destination ports hit by a single source IP within the window that trigger a port_scan event
SERVERBEE_SECURITY__DATA_DIR/var/lib/serverbee/securityDirectory for the persistent first_seen store used to mark ssh_login events as new (user, IP) combinations

Server Configuration (server.toml)

[server] -- Core Server Settings

KeyTypeDefaultDescription
listenstring"0.0.0.0:9527"IP address and port the server listens on
data_dirstring"./data"Directory for database files and other persistent data
trusted_proxiesstring[]private/loopback CIDRsCIDR ranges of trusted reverse proxies. Defaults to RFC 1918 + loopback ranges. Set to [] to disable X-Forwarded-For extraction

[database] -- Database Settings

KeyTypeDefaultDescription
pathstring"serverbee.db"Database filename (relative to data_dir)
max_connectionsu3210Maximum number of connections in the SQLite pool

[auth] -- Authentication Settings

KeyTypeDefaultDescription
session_ttli6486400Session cookie lifetime in seconds (24 hours)
max_serversu320Maximum servers allowed via enrollment (0 = no limit). Best-effort soft cap
secure_cookiebooltrueSet the Secure flag on session cookies. Use false only when the browser accesses ServerBee over plain HTTP

[dev] -- Local Development

KeyTypeDefaultDescription
demo_databoolfalseReset and seed the synthetic local development dataset. Guarded to database.path = "dev-demo.db" so it cannot accidentally run against normal local or production-copy databases

[retention] -- Data Retention

KeyTypeDefaultDescription
records_daysu327Days to keep raw metric records
records_hourly_daysu3290Days to keep hourly aggregated records
gpu_records_daysu327Days to keep per-GPU metric records
ping_records_daysu327Days to keep ping probe records
network_probe_daysu327Days to keep raw network probe records
network_probe_hourly_daysu3290Days to keep hourly aggregated network probe records
audit_logs_daysu32180Days to keep audit log entries
traffic_hourly_daysu327Days to keep hourly traffic records
traffic_daily_daysu32400Days to keep daily traffic records
task_results_daysu327Days to keep task execution results
docker_events_daysu327Days to keep Docker event records
service_monitor_daysu3230Days to keep service monitor check records
security_event_daysu3230Days to keep security event records (SSH login/brute force, port scan)
ip_quality_event_daysu3290Days to keep IP quality status-change event records

Raw metric records are written every 60 seconds and retained for 7 days by default. The hourly aggregator computes averages so you can keep 90 days of long-term trends without excessive storage. Tune these values to match your disk space and monitoring needs.

[scheduler] -- Scheduler

KeyTypeDefaultDescription
timezonestring"UTC"Timezone for daily traffic aggregation and billing cycle computation. Use IANA timezone names (e.g. Asia/Shanghai, US/Eastern)

[rate_limit] -- Rate Limiting

KeyTypeDefaultDescription
login_maxu325Maximum login attempts per rate-limit window
register_maxu3210Maximum agent registration attempts per rate-limit window. Admins can clear active windows via Settings → Rate limits

[log] -- Logging

KeyTypeDefaultDescription
levelstring"info"Log verbosity: trace, debug, info, warn, error
filestring""Path to log file. If empty, logs go to stdout only

The log level can also be set via the RUST_LOG environment variable, which takes precedence.

[geoip] -- GeoIP Lookup

KeyTypeDefaultDescription
mmdb_pathstring""Path to a MaxMind-compatible MMDB file. Non-empty path enables this custom GeoIP database; if empty, the UI can download DB-IP Lite into the server data directory

[asn] -- ASN Lookup (Traceroute)

KeyTypeDefaultDescription
mmdb_pathstring""Path to a DB-IP Lite ASN / MaxMind GeoLite2-ASN MMDB file. Non-empty path enables this custom ASN database; if empty, the UI can download DB-IP Lite ASN into the server data directory. Used to label each traceroute hop with its autonomous system

[resend] -- Email Notifications

KeyTypeDefaultDescription
api_keystring""Resend API key (resend.com/api-keys). Required to use the Email notification channel. The from address on each email channel must belong to a domain verified at resend.com/domains

[oauth] -- OAuth / SSO

KeyTypeDefaultDescription
base_urlstring""Public URL of your ServerBee instance (for callback URLs)
allow_registrationboolfalseCreate new user accounts on first OAuth login

[oauth.github] -- GitHub OAuth

KeyTypeDefaultDescription
client_idstring--GitHub OAuth App client ID
client_secretstring--GitHub OAuth App client secret

[oauth.google] -- Google OAuth

KeyTypeDefaultDescription
client_idstring--Google OAuth client ID
client_secretstring--Google OAuth client secret

[oauth.oidc] -- OpenID Connect

KeyTypeDefaultDescription
issuer_urlstring--OIDC issuer URL (e.g., https://auth.example.com/realms/main)
client_idstring--OIDC client ID
client_secretstring--OIDC client secret
scopesstring[]["openid", "email", "profile"]OAuth scopes to request

[upgrade] -- Agent Upgrade

KeyTypeDefaultDescription
release_base_urlstring"https://github.com/ZingerLittleBee/ServerBee/releases"Base URL for agent upgrade release assets. The server appends /download/v{version}/ to construct the asset download URL
latest_version_urlstring""Optional custom URL for latest version API. If empty, the server queries GitHub API to determine the latest version. Use this to override with a custom version endpoint
channelstring"stable"Release channel used by the dashboard version check. Set to "beta" to select the newest published GitHub prerelease

[file] -- File Upload (Server-side)

KeyTypeDefaultDescription
max_upload_sizeu64104857600Maximum file upload size in bytes (default 100 MB)

[mobile] -- Mobile Authentication

KeyTypeDefaultDescription
access_ttli64900Mobile access token lifetime in seconds (default 15 minutes)
refresh_ttli642592000Mobile refresh token lifetime in seconds (default 30 days)

[push_relay] -- Verified Mobile Setup

KeyTypeDefaultDescription
urlstring""Public Push Relay HTTPS URL. Empty disables notification registration. Apple signing keys stay exclusively in the Worker.

Set SERVERBEE_PUSH_RELAY__URL to the final HTTPS Worker URL. “Verified” here means authenticated Server account, installation and session ownership; there is no App Attest or Relay grant. The app registers its token, APNs environment and per-installation content key with the Server over HTTPS. The Server encrypts content and sends token, environment, event identity, expiry and envelope to the Worker's public POST /v1/send. Local Server fixtures may use http://127.0.0.1:<port>; the app requires HTTPS and rejects redirects.

Worker-only bindings are APNS_TEAM_ID, APNS_KEY_ID, APNS_TOPIC, APNS_ENVIRONMENTS and the APNS_PRIVATE_KEY secret containing PKCS#8 PEM text. They never belong in Server configuration or the app. APNS_TOPIC=app.serverbee matches the official main app; never use the extension identifier app.serverbee.notifications. APNS_ENVIRONMENTS=sandbox,production allows both device environments; topic and APNs hosts are fixed by the Worker. There is no database, challenge/grant lifecycle, version/distribution policy or Bun/OpenSSL runtime. See Cloudflare setup.

The public endpoint accepts abuse risk: known valid tokens can receive junk/generic notifications, while arbitrary traffic or an attacker's own token can consume quota. Strict payload limits, bounded streaming reads, deadlines, concurrency and bounded isolate-local source/target rate limits are best-effort safeguards, not global admission or cost guarantees. Content keys and business plaintext never cross Relay.

The Server retains authenticated subscriptions, recipient checks, durable encrypted outbox/retry, and a 30-minute deadline from original event creation. Alert triggers/recoveries, administrator security-rule matches and owner-only final scheduled-task outcomes remain supported; task success is opt-in. Role/session/subscription/revision changes stop later eligible sends. Terminal ciphertext is erased, and accepted or in-flight notifications cannot be recalled. APNs acceptance is a provider receipt, not proof of device presentation. Shared app/NSE Keychain signing and live device acceptance still require separate verification. See Mobile and Push Relay Operations.

[firewall] -- Firewall Blocklist Guardrail

KeyTypeDefaultDescription
allow_liststring[][]CIDRs / IPs the server refuses to insert into block_list. Tier-2 guardrail on top of the hard-coded Tier-1 protected ranges (loopback + RFC 1918 + link-local + multicast + unspecified). See Firewall Blocklist

[ip_quality] -- IP Quality Risk Scoring

By default, the Server calls ipapi.is anonymously (100 requests per client IP per UTC day). ServerBee uses the minimal response's proxy, VPN, datacenter, Tor, and abuse flags and derives an IP type, but no numeric risk score. A free account/API key provides 1,000 requests per day and the full response required for the 0–100 score. The Server falls back to ip-api.com only when the primary request fails, including HTTP 429, not when a successful response lacks a score. Local baseline metadata is available only when a usable GeoIP MMDB is loaded. See IP Quality for details and the fallback's non-commercial/HTTP warning.

KeyTypeDefaultDescription
risk_providerstring"ipapi_is"Primary risk provider. One of: none, ipapi_is, ip-api.
risk_provider_fallbackstring"ip-api"Fallback provider triggered on primary failure. Set to none to disable.

[ip_quality.ipapi_is] -- ipapi.is

KeyTypeDefaultDescription
api_keystring--Optional. A free account key provides 1,000 requests per day and the full response required for the 0–100 score.
endpointstring""Override for self-hosted mirrors or testing. Empty falls back to the built-in default https://api.ipapi.is.

[network_probe] -- Anomaly Thresholds

KeyTypeDefaultDescription
high_latency_msf64500Records above this average latency are classified as high_latency
very_high_latency_msf64800Records above this average latency are classified as very_high_latency

Agent Configuration (agent.toml)

Top-Level Options

KeyTypeDefaultDescription
server_urlstringrequiredURL of the ServerBee server (e.g., http://10.0.0.1:9527)
tokenstring""Agent authentication token. When enrollment is needed, the Agent generates and persists this token before claiming the offer; the Server stores only its hash
enrollment_codestring""One-time enrollment offer from Add Server or the Server's Agent Authority actions (used only when token is empty; consumed on first successful claim)

[collector] -- Metric Collection

KeyTypeDefaultDescription
intervalu323Compatibility-only field. The Agent currently ignores it and uses the Server's Welcome.report_interval, fixed at 3 seconds
enable_gpuboolfalseEnable NVIDIA GPU monitoring (requires a build with the gpu feature and an NVIDIA driver that provides NVML)
enable_temperaturebooltrueEnable CPU temperature sensor monitoring

[file] -- File Management

KeyTypeDefaultDescription
enabledboolfalseEnable the file-management subsystem (path sandbox). The agent must also report the file capability — add file to the [capabilities] allow list
root_pathsstring[][]Restrict browsing to these directories. Empty array rejects all file operations
max_file_sizeu641073741824Maximum file size (bytes) for read and download operations (default 1 GB)
deny_patternsstring[]["*.key", "*.pem", "id_rsa*", ".env*", "shadow", "passwd"]Glob patterns for files the agent will refuse to access

[capabilities] -- Agent-Owned Capability Policy

Capabilities are owned by the agent host. The agent starts from the default set (CAP_DEFAULT = 1852), applies allow/deny from this block, then applies any --allow-cap/--deny-cap CLI flags, and reports the result to the server. The server cannot override this. See Capabilities for the full key list and enforcement model.

KeyTypeDefaultDescription
allowstring[][]Capability keys to enable on top of the default set, e.g. ["terminal", "file"]. Valid keys: terminal, exec, upgrade, ping_icmp, ping_tcp, ping_http, file, docker, security_events, firewall_block, ip_quality
denystring[][]Capability keys to strip from the default set. deny wins over allow. Unknown keys are rejected at startup
temporary_max_durationstring"24h"Maximum duration a single temporary capability grant can last (e.g. 30m, 2h, 1d). Used by the host-local serverbee-agent grant CLI. See Capabilities → Temporary grants
state_dirstring"/var/lib/serverbee"Directory where the agent persists capability_grants.json (the temporary-grants store). Must be writable by the agent
[capabilities]
allow = ["terminal", "file"]
deny = ["ip_quality"]
# Footgun guard for `serverbee-agent grant --for ...`; defaults to 24h.
temporary_max_duration = "24h"
state_dir = "/var/lib/serverbee"

[ip_change] -- IP Change Detection

KeyTypeDefaultDescription
enabledbooltrueEnable periodic IP change detection. Agent enumerates NIC addresses and reports changes
external_ip_urlsstring[]["https://api.ipify.org", "https://ifconfig.me/ip", "https://icanhazip.com", "https://checkip.amazonaws.com"]Ordered list of services that return the agent's public IP. Tried in sequence at startup and on every check; first success wins. Required for agents behind NAT or in containers. Set to [] to disable external lookups (air-gapped deployments)
interval_secsu64300IP check interval in seconds (default 5 minutes)

[security] -- Security Event Detection

KeyTypeDefaultDescription
enabledbooltrueEnable local security-event detection
data_dirstring"/var/lib/serverbee/security"Writable directory for detector state
ssh.window_secondsu3260Sliding window for failed SSH-login detection
ssh.failed_thresholdu3210Failed SSH attempts in the window before reporting an event
port_scan.enabledboolfalseEnable local port-scan detection
port_scan.window_secondsu3230Sliding port-scan detection window
port_scan.distinct_port_thresholdu3220Distinct destination ports in the window before reporting an event

[log] -- Logging

KeyTypeDefaultDescription
levelstring"info"Log verbosity: trace, debug, info, warn, error
filestring""Path to log file. If empty, logs go to stdout only

[upgrade] -- Upgrade Source (Agent)

The agent downloads upgrades from a locally-pinned release source rather than trusting a URL from the server.

KeyTypeDefaultDescription
release_repo_urlstring"https://github.com/ZingerLittleBee/ServerBee/releases"Base URL for agent upgrade release assets. Must replicate the GitHub releases directory layout: {base}/download/v{version}/{asset} for binaries and {base}/download/v{version}/sha256sums.txt for checksum verification. The compile-time default is overridable via the SERVERBEE_RELEASE_REPO build-time env var
release_cert_spki_sha256string""Optional TLS SPKI pin for the release host. Set to 64 lowercase hex characters (SHA-256 of the leaf certificate's SubjectPublicKeyInfo DER encoding). Empty disables pinning. If set, the agent additionally validates the leaf cert SPKI after standard chain validation. Invalid format (non-64-char or non-hex) is rejected at startup

Configuration precedence (highest wins):

  1. --release-repo CLI flag
  2. SERVERBEE_UPGRADE__RELEASE_REPO_URL environment variable
  3. /etc/serverbee/agent.toml or agent.toml [upgrade] section
  4. Compile-time default (official GitHub releases URL)

The dashboard "latest version" check uses the Server-configured release source (upgrade.release_base_url / upgrade.latest_version_url). Those are separate Server-side settings used only for the dashboard's "latest version" lookup, and are distinct from the Agent's [upgrade] release_repo_url, which governs what the Agent actually downloads. For consistent upgrade behavior, point both the Server and the Agent at the same release repository unless you intentionally want them to track different sources.

How to obtain the SPKI pin for a release host certificate:

openssl x509 -in cert.pem -pubkey -noout \
  | openssl pkey -pubin -outform der \
  | openssl dgst -sha256 -r | awk '{print $1}'

Example: Minimal Server Configuration

[server]
data_dir = "./data"

Everything else uses sensible defaults. On first startup, ServerBee creates the admin user with a random password and prints it once to the server logs.

Example: Production Server Configuration

[server]
listen = "127.0.0.1:9527"
data_dir = "/var/lib/serverbee"

[auth]
secure_cookie = true

[retention]
records_days = 14
records_hourly_days = 180

[geoip]
mmdb_path = "/var/lib/serverbee/GeoLite2-City.mmdb"

[asn]
mmdb_path = "/var/lib/serverbee/GeoLite2-ASN.mmdb"

[log]
level = "info"
file = "/var/log/serverbee/server.log"

[oauth]
base_url = "https://monitor.example.com"
allow_registration = false

[oauth.github]
client_id = "Iv1.abc123"
client_secret = "secret123"

Example: Minimal Agent Configuration

server_url = "http://your-server-ip:9527"
enrollment_code = "<one-time code from Add Server>"

Example: Production Agent Configuration

server_url = "https://monitor.example.com"
token = "<agent-generated persisted token>"

[collector]
enable_gpu = true  # Requires a GPU-enabled build and an NVIDIA driver that provides NVML
enable_temperature = true

[file]
enabled = true
root_paths = ["/home", "/var/log", "/etc"]
max_file_size = 1073741824
deny_patterns = ["*.key", "*.pem", "id_rsa*", ".env*", "shadow", "passwd"]

[ip_change]
enabled = true
# external_ip_urls defaults to a curated list of public IP services.
# Override only to point at internal mirrors or to disable (set to []).

[log]
level = "info"
file = "/var/log/serverbee/agent.log"