Skip to content

Environment variables

The server reads its settings from environment variables with the PFCENTRAL_ prefix. The server fails to start on an unknown value type or an invalid combination, and names the variable in the log.

PFCENTRAL_DATABASE_URL=postgres://pf_central:secret@db:5432/pf_central?sslmode=require
PFCENTRAL_SERVER_BASE_URL=https://pf.example.com
PFCENTRAL_TRUSTED_ORIGINS=https://pf.example.com
PFCENTRAL_TOKEN_PEPPER_CURRENT=<long random string>
PFCENTRAL_TOKEN_PEPPER_VERSIONS=<the same string>
PFCENTRAL_LOG_LEVEL=info

Add PFCENTRAL_NATS_TLS_ENABLED=true and PFCENTRAL_NATS_TLS_HOSTS when agents connect over the internet. See Plan your deployment.

VariableDefaultMeaning
PFCENTRAL_ENVIRONMENTproductionproduction or development. Development is needed for dev login shortcuts and admin seed.
PFCENTRAL_SERVER_ADDR:2808HTTP listen address. The server speaks plain HTTP; put a proxy in front for HTTPS.
PFCENTRAL_SERVER_BASE_URLhttp://localhost:2808The public URL of the web UI. Used in setup, invite and reset links.
PFCENTRAL_STATE_DIR./data/state (/data/state in the image)Where NATS keys, credentials, the NATS CA and JetStream data live. Back it up with the database.
VariableDefaultMeaning
PFCENTRAL_DATABASE_URLpostgres://postgres:postgres@127.0.0.1:5432/pf_central?sslmode=disablePostgreSQL connection string. Migrations run on every start.
PFCENTRAL_DATABASE_EMBEDDEDfalseDevelopment only. Starts a PostgreSQL inside the process and ignores DATABASE_URL.
PFCENTRAL_DATABASE_EMBEDDED_DATA_DIR./data/postgresDevelopment only. Data directory for the embedded database.
PFCENTRAL_DATABASE_EMBEDDED_PORT45433Development only. Port for the embedded database.
VariableDefaultMeaning
PFCENTRAL_TRUSTED_ORIGINShttp://localhost:2808;http://localhost:2810Origins allowed to submit forms, with scheme and port. Must include the address users type in the browser.
PFCENTRAL_COOKIE_SECUREtrueMarks the session cookie Secure. Browsers then send it only over HTTPS. Set false only for a plain-HTTP lab.
PFCENTRAL_SUPERUSER_EMAIL—With the password below, creates the first owner at first start, without a setup link.
PFCENTRAL_SUPERUSER_PASSWORD—At least 12 characters.
PFCENTRAL_AUTHZ_ENFORCEtruefalse turns role checks off: every signed-in member may do everything. A recovery switch only; the server logs a warning.
PFCENTRAL_SHOW_DEV_LOGINSfalseDevelopment only. Shows login shortcuts on the sign-in page.

Sessions last 24 hours, and end after 30 minutes without activity. These times are fixed.

VariableDefaultMeaning
PFCENTRAL_TOKEN_PEPPER_CURRENTpepper-v1Secret mixed into new hashes of device secrets, API tokens and one-time links. Change it before the first start. The default is public.
PFCENTRAL_TOKEN_PEPPER_VERSIONSpepper-v1All peppers accepted when checking a hash. Must include the current one. See Rotate the pepper.
VariableDefaultMeaning
PFCENTRAL_NATS_MODEembeddedembedded runs the broker inside pfCentral. external uses your own broker (below).
PFCENTRAL_NATS_LISTENnats://0.0.0.0:24222Address and port where agents connect.
PFCENTRAL_NATS_TLS_ENABLEDfalseTLS on the agent port. pfCentral makes a CA and a certificate on first start and serves the CA at /nats-ca.crt.
PFCENTRAL_NATS_TLS_HOSTS127.0.0.1;localhostNames and addresses in the certificate. Must include the host in every agent’s NATS URL.
PFCENTRAL_NATS_PING_INTERVAL20sHow often the broker pings each client.
PFCENTRAL_NATS_MAX_PINGS_OUT2Unanswered pings before the broker drops a client.
PFCENTRAL_NATS_CALLOUT_TTL1hLifetime of the pass each agent gets at login. Agents renew it on their own. Both modes.

Read only when PFCENTRAL_NATS_MODE=external. See Bring your own NATS.

VariableDefaultMeaning
PFCENTRAL_NATS_URLnats://127.0.0.1:24222Your broker’s URL.
PFCENTRAL_NATS_CREDS_FILE—Required. Credentials for pfCentral’s main connection.
PFCENTRAL_NATS_CALLOUT_CREDS_FILE—Required. Credentials for the login-check (callout) connection.
PFCENTRAL_NATS_SENTINEL_CREDS_FILE—Required. The shared, permission-less login handed to agents at enrollment.
PFCENTRAL_NATS_SIGNING_KEY_PATH—Required. The account signing key seed pfCentral uses to sign agent passes.
PFCENTRAL_NATS_RESOURCE_PREFIX—Prefix for stream and bucket names, to share one account between installs.
VariableDefaultMeaning
PFCENTRAL_NATS_REGISTRY_SWEEP_INTERVAL5sPresence check interval.
PFCENTRAL_NATS_REGISTRY_MAX_MISSED_SWEEPS3Missed checks before a device is offline. With the defaults: 5 s × 3 = 15 s.
PFCENTRAL_NATS_DISCOVERY_ENRICH_ATTEMPTS5Tries to read a device’s details when it first connects.
PFCENTRAL_NATS_DISCOVERY_ENRICH_TIMEOUT500msTimeout for each try.
PFCENTRAL_NATS_DISCOVERY_ENRICH_BACKOFF200msWait between tries.
PFCENTRAL_STATE_CACHE_TTL5mHow long the latest device state is kept in the device-state bucket.
PFCENTRAL_STATE_CACHE_REFRESH_COOLDOWN30sMinimum time between background refreshes of a cached list.
VariableDefaultMeaning
PFCENTRAL_RATELIMIT_GLOBAL_RPM600Requests per minute for the whole server process, shared by all users and scripts. Over the limit: HTTP 429.
PFCENTRAL_LOG_LEVELdebugdebug, info, warn or error. Set info in production.
PFCENTRAL_LOG_JSONtruetrue for JSON lines; false for coloured text.

All ignored unless PFCENTRAL_EMAIL_ENABLED=true. See Email delivery.

VariableDefaultMeaning
PFCENTRAL_EMAIL_ENABLEDfalseSend invite and password-reset emails.
PFCENTRAL_EMAIL_ENCRYPTION_KEY—Required. Base64 of exactly 32 bytes (openssl rand -base64 32). Encrypts queued emails.
PFCENTRAL_EMAIL_PROVIDERsmtpsmtp, resend or cloudflare.
PFCENTRAL_EMAIL_FROM—Required. Sender address.
PFCENTRAL_EMAIL_FROM_NAMEpf-centralSender name.
PFCENTRAL_EMAIL_REPLY_TO—Optional Reply-To.
PFCENTRAL_EMAIL_TIMEOUT15sTimeout for each send.
PFCENTRAL_EMAIL_RETRY_MAX5Attempts before an email is given up.
PFCENTRAL_EMAIL_RETENTION720hHow long sent and failed email records are kept.
PFCENTRAL_EMAIL_SMTP_HOST—Required for smtp.
PFCENTRAL_EMAIL_SMTP_PORT587
PFCENTRAL_EMAIL_SMTP_TLSstarttlsstarttls, implicit, opportunistic or none.
PFCENTRAL_EMAIL_SMTP_AUTHplainplain, login or none.
PFCENTRAL_EMAIL_SMTP_USERNAME—
PFCENTRAL_EMAIL_SMTP_PASSWORD—
PFCENTRAL_EMAIL_RESEND_API_KEY—Required for resend.
PFCENTRAL_EMAIL_CLOUDFLARE_ACCOUNT_ID—Required for cloudflare.
PFCENTRAL_EMAIL_CLOUDFLARE_API_TOKEN—Required for cloudflare.

The agent reads /usr/local/etc/nats-agent/config.yaml. The pfSense package writes this file when you click Save in Services → pfCentral → Settings, so you rarely edit it. Most keys also have an environment variable, which wins over the file.

KeyVariableDefaultMeaning
device_idPFCENTRAL_AGENT_DEVICE_IDrequiredThe SMBIOS UUID, lower case. Set by the package.
device_namePFCENTRAL_AGENT_DEVICE_NAMEhostnameName shown in pfCentral.
sitePFCENTRAL_AGENT_SITE—Free-text location label.
ip_address—detectedAddress shown in pfCentral and used by Open WebUI.
model——Hardware model shown in pfCentral.
nats_urlPFCENTRAL_AGENT_NATS_URLnats://127.0.0.1:24222 (package)pfCentral’s NATS address. tls:// for TLS.
log_levelPFCENTRAL_AGENT_LOG_LEVELinfodebug, info, warn, error.
log_jsonPFCENTRAL_AGENT_LOG_JSONfalseJSON log lines.
binary_urlPFCENTRAL_AGENT_BINARY_URLthe public releaseWhere Download & Restart gets a new agent.
config_pathPFCENTRAL_AGENT_CONFIG_PATH/cf/conf/config.xmlThe pfSense configuration the agent reads and writes.
heartbeat_interval—5sPresence heartbeat interval.
telemetry_intervalPFCENTRAL_AGENT_TELEMETRY_INTERVAL2sTelemetry interval. At least 1s. See Scaling.
auth.methodPFCENTRAL_AGENT_AUTH_METHODcallout (package)How the agent logs in. The package always uses callout.
auth.enroll_urlPFCENTRAL_AGENT_AUTH_ENROLL_URL—pfCentral’s /enroll URL.
auth.bootstrap_tokenPFCENTRAL_AGENT_AUTH_BOOTSTRAP_TOKEN—One-time enrollment token.
auth.sentinel_creds_filePFCENTRAL_AGENT_AUTH_SENTINEL_CREDS_FILE—Written at enrollment.
auth.connect_secret_filePFCENTRAL_AGENT_AUTH_CONNECT_SECRET_FILE—Written at enrollment.
auth.ca_filePFCENTRAL_AGENT_NATS_CA—CA for tls://. Empty means no TLS.

The installer script has its own variables; see Enroll firewalls.