FF_ variables. There is no FF_PORT — the port comes only from http.serve({ port }) in your JS.
These are runtime configuration, read directly by the CLI/runtime. They are
separate from application env access: --allow-env controls what
process.env exposes to JS, not whether FF_* works.
Quick look
--allow-net flag is for the app’s server, not for the FF_* variable.
Add the app’s other flags as needed.
Reference
FF_ECHO — smoke mode
Any value enables it — the check is “is the variable set?”, so even
FF_ECHO= (empty) counts. Every request gets 200 {"message":"ok"}
without running your handler:
Only unsetting disables echo mode.
FF_ECHO= ff server.js
(empty value) does enable it; FF_ECHO=0 also enables it (the
value is never inspected).FF_CERT / FF_KEY — TLS without flags
ff start accepts --cert/--key; when the flags are absent, these env vars fill in:
--allow-read. File paths passed to http.serve({ tls }) are runtime reads
and do. See the TLS guide for generating and verifying.
FF_CA_FILE — trust a private CA
Points fetch and WSS clients at an extra CA bundle (PEM path):
FF_CA_FILE only changes trust. It does not grant network access:
outbound fetch / WebSocket calls still need --allow-net for their
host and port.
Unlike --ca (which ff start rejects), FF_CA_FILE works everywhere, including ff start. When TLS is started with --cert/FF_CERT, that cert path is additionally trusted by the runtime’s own outbound clients — handy for self-signed dev loops.
Reading env in code
process.env is a plain object snapshot of the environment, filtered by
--allow-env. Only granted names appear; everything else is undefined:
process.env reflects the environment at startup. There is no
.env file loader — export variables in your shell (or prefix the command,
as above) before starting ff. Bare --allow-env grants every name;
--allow-env=PORT,API_TOKEN grants just those two.Runtime config vs application env
The runtime readsFF_* directly, outside process.env. --allow-env only
controls what JavaScript can see:
process.env.FF_ECHO is undefined even though echo mode
is active. The same applies to FF_CERT, FF_KEY, and FF_CA_FILE.
Database environment variables
The built-in Postgres client (sql global) inspects database configuration variables when granted by --allow-env:
Like application variables, these are only read if explicitly permitted with
--allow-env:
Practical example: dev vs prod startup
Troubleshooting
Port env var does nothing — the runtime does not readPORT or FF_PORT; set the port in http.serve({ port }). Your app may read PORT itself, but only with --allow-env=PORT.
process.env.X is undefined — either the variable was not exported, or
--allow-env does not include it. Check both: X=1 ff app.js --allow-env=X.
No .env file is read.
FF_ECHO works but process.env.FF_ECHO is undefined — expected.
FF_* variables are runtime config; JS sees them only with a matching
--allow-env grant.
--ca rejected by ff start — expected. Use FF_CA_FILE with ff start; --ca works only with ff <file> and ff -e.
FF_CA_FILE set but fetch still denied — trust and permission are
separate. Add --allow-net=<host>:<port> for the request.
TLS didn’t start with env set — both FF_CERT and FF_KEY must be set, files must exist and be within size caps, and explicit --cert/--key flags override env.
Echo mode won’t turn off — FF_ECHO= (empty) and FF_ECHO=0 both keep it on. unset FF_ECHO is the only way off.