Configuration
Fullfinity is configured via config.yaml. With Docker Compose, copy config.example.yaml (in
deploy/) to config.yaml and add the two signing secrets before the first docker compose up
(see Installation); nothing creates it for you.
Quick Reference
Section titled “Quick Reference”# config.yaml — Docker defaults, as in config.example.yamlWORKERS: 2SERVER_PORT: 8000
DB_USERNAME: "fullfinity"DB_PASSWORD: "fullfinity"DB_HOST: "db" # the Compose service nameDB_PORT: "5432"DB_POOL_MIN_CONNECTIONS: 5DB_POOL_MAX_CONNECTIONS: 10
VALKEY_HOST: "cache" # the Compose service nameVALKEY_PORT: 6379
FILESTORE_PATH: "/app/filestore" # a named volume in the Compose stackSECRET_KEY: "<output of openssl rand -hex 32>"REFRESH_SECRET_KEY: "<output of openssl rand -hex 32>"
MODULE_PATHS: - "fullfinity/modules" - "fullfinity/enterprise" - "/app/modules" # a folder you mounted into the containerDatabase Configuration
Section titled “Database Configuration”DB_USERNAME: "fullfinity"DB_PASSWORD: "fullfinity"DB_HOST: "db" # Docker service nameDB_PORT: "5432"DB_POOL_MIN_CONNECTIONS: 5 # Minimum connections kept in pool (per db, per worker)DB_POOL_MAX_CONNECTIONS: 10 # Maximum concurrent connections (per db, per worker)# DB_MAX_INACTIVE_LIFETIME: 300 # Seconds an idle pooled connection lingers before closing# DB_STATEMENT_CACHE_SIZE: 1000 # Per-connection prepared-statement cache; 0 for a # transaction-mode pooler (see "Running behind PgBouncer")Connection pooling — built in
Section titled “Connection pooling — built in”Fullfinity maintains its own connection pool per database (one pool per worker
process), so you do not need an external pooler for a single-node deployment. Tune
it with DB_POOL_MIN_CONNECTIONS / DB_POOL_MAX_CONNECTIONS above.
Because the pool is per worker process and per database, the connections a Postgres server sees is roughly:
workers × databases-in-use × DB_POOL_MAX_CONNECTIONSOn a single node with a handful of tenant databases this stays well under Postgres’s
default max_connections (~100) and no external pooler is warranted. Reach for
PgBouncer only when that product grows large enough to threaten the Postgres
connection ceiling — many worker processes multiplied by many tenant databases.
Running behind PgBouncer
Section titled “Running behind PgBouncer”Fullfinity uses prepared statements (asyncpg’s statement cache) for performance, so if you put PgBouncer in front of Postgres, pick one of the two supported modes below.
- Session pooling (
pool_mode = session) — always compatible, but gives up most of PgBouncer’s connection multiplexing (each client holds a server connection for its lifetime), so it does little to reduce the connection count. In a multi-tenant deployment, setDB_POOL_MIN_CONNECTIONS: 0(and a shortDB_MAX_INACTIVE_LIFETIME, e.g.120) — otherwise every tenant’s pool keepsminconnections open forever, and in session mode each one pins a Postgres backend for as long as it stays open, so idle tenants would hold backends they aren’t using. - Transaction pooling (
pool_mode = transaction) — the mode worth using for connection relief. Two ways to make asyncpg’s prepared statements safe under it:-
Let PgBouncer track them — PgBouncer ≥ 1.21 with
max_prepared_statementsset to a non-zero value inpgbouncer.ini(it defaults to0= disabled). The version alone is not enough — you must set both:; pgbouncer.inipool_mode = transactionmax_prepared_statements = 200 ; must exceed DB_POOL_MAX_CONNECTIONS-worth of distinct; statements; 0 (the default) breaks prepared statements -
Turn the client-side cache off — set
DB_STATEMENT_CACHE_SIZE: 0. asyncpg then stops caching named prepared statements, so a backend reused across clients can’t collide on them. This is the escape hatch for a pooler that is older than 1.21 or doesn’t exposemax_prepared_statements(some hosted PgBouncer / RDS-Proxy-style products) — it trades a little per-query planning overhead for transaction-mode compatibility. LeaveDB_STATEMENT_CACHE_SIZEunset (default1000) for session mode or a direct connection.
-
The default is deliberately much larger than asyncpg’s own 100. One record form issues
around fifty distinct statement shapes and browsing a handful of models passes a hundred, so
a cache of 100 evicts statements faster than they are reused and every query re-pays its
planning cost — measurably slower than disabling the cache outright. The size is chosen
against the whole application rather than one session, because a pooled connection serves
every model rather than a slice of them.
The cache is per connection, not per database, so its memory cost multiplies by the same figure as the connection count above:
workers × databases-in-use × DB_POOL_MAX_CONNECTIONS × DB_STATEMENT_CACHE_SIZE × ~9KBA single-database node (2 workers, pool of 10) tops out around 180MB of PostgreSQL backend
memory; a node hosting many tenant databases multiplies that by the number of databases in
use. Lower DB_STATEMENT_CACHE_SIZE for multi-tenant deployments — a per-tenant
connection only ever executes the shapes that tenant’s users touch, so a few hundred is
ample there, and the ceiling above is what you are trading against. The cap is an upper
bound rather than an allocation: a connection caches only the statements it actually runs,
and anything idle longer than asyncpg’s max_cached_statement_lifetime is dropped.
Three things a pooler changes that aren’t obvious
Section titled “Three things a pooler changes that aren’t obvious”TLS is negotiated unless you say otherwise. The driver disables it automatically when
DB_HOST is a loopback address — but a pooler is normally reached by hostname, at which point it
is no longer recognised as local and every new connection pays a TLS handshake to encrypt traffic
that never leaves the machine. Set it explicitly:
DB_SSL: disable # a pooler on this hostAccepted values are true/false and PostgreSQL’s own sslmode names (disable, prefer,
require, verify-ca, verify-full).
A missing database does not fail fast. Connecting directly, PostgreSQL answers immediately that the database does not exist. Through a pooler the attempt simply waits, so what surfaces is a connection-acquisition timeout after several seconds. If you are debugging a database that was dropped or renamed, that timeout is the symptom — not a slow server.
Session mode keeps server connections after the client has gone. A pooler in session mode holds
its server connection for its own server_idle_timeout (often ten minutes) once the client
disconnects. Anything requiring a database to have no connections is therefore blocked for that
window — most visibly CREATE DATABASE ... TEMPLATE, which refuses to copy a database anyone is
attached to. If you clone from a prepared template, expect it to be unclonable for a few minutes
after any process connects to it (a migration run, for instance), and mark the source
IS_TEMPLATE — the engine may then clear a template’s idle connections itself, while still
refusing to interrupt one running a query.
Schema changes are handled automatically: when a module is installed or upgraded
(-u all), the engine proactively recycles pooled connections so no cached prepared
statement can outlive the schema it was planned against — you don’t need to restart or
flush anything by hand.
Database Selector Settings
Section titled “Database Selector Settings”Control how users select and access databases.
SHOW_DBS: True # Enable database selector UIDB_FILTER: None # No filter - all databases availableDEFAULT_DB: None # No default - resolve automatically or askSTALE_DB_REDIRECT_URL: None # Where a request goes when its database is goneDEFAULT_DB
Section titled “DEFAULT_DB”The database to serve when a request carries neither an X-DB-NAME header nor a db cookie.
Unset (the default), the server resolves automatically only when it hosts exactly one database, and otherwise sends the caller to the selector. That is fine for a single-database install, but it stops resolving the moment a second database appears — including databases the public should never be offered.
DEFAULT_DB: "acme_production"With a default configured:
- a request with no header and no cookie is served that database;
- a
dbcookie pointing at a database that no longer exists is cleared and the browser is sent to/, which then resolves to the default — instead of the selector.
The same resolution answers the app’s realtime connection, not only ordinary requests: a browser
that was never made to pick a database — one database on the server, or a DEFAULT_DB — carries
no db cookie, and its live connection resolves exactly as its requests do.
It answers public website pages too, which matters for search engines: a visitor with no db
cookie — every crawler, on every visit — is served the page directly, with that database’s own
website routes and controllers, never redirected to have a cookie planted first.
The second point makes a dropped database a graceful landing rather than a dead end, which matters for deployments that create and destroy databases routinely.
STALE_DB_REDIRECT_URL
Section titled “STALE_DB_REDIRECT_URL”Where a browser goes when its db cookie names a database that no longer exists.
Unset, a missing database is treated as a mistake: the caller is offered the selector, or / when
DEFAULT_DB names a fallback. That suits an installation whose databases are permanent, where a
missing one means a stale cookie after a restore or a rename.
Set it when your databases are ephemeral by design — per-visitor environments, review apps, anything created and reclaimed on a schedule. There a missing database is the normal end of a session, not an error, and this names the page that says so:
STALE_DB_REDIRECT_URL: /session-endedThe same target is sent to the app in the JSON of the 409 DATABASE_NOT_FOUND its background
requests receive, so a navigation and a background request cannot disagree about where a dead
database leads. Without it, those requests send the browser to the selector — which SHOW_DBS: False answers with a 404.
DEAD_POOL_SWEEP_SECONDS
Section titled “DEAD_POOL_SWEEP_SECONDS”How often a worker checks whether the databases it holds pools for still exist, in seconds
(default 300; 0 disables it).
Each worker keeps a connection pool and a composed model cache per database it has served, and cleanup on deletion only happens in the worker that performed the deletion — the others have no reason to touch that database again. On an installation with permanent databases this sweep finds nothing and costs one catalog query per interval. On one that creates and drops databases, it is what stops each worker accumulating the pools and caches of every database it has ever served.
SHOW_DBS
Section titled “SHOW_DBS”Controls whether users can access the database selector page (/web/database-selector).
| Value | Behavior |
|---|---|
True | Database selector is accessible |
False | Database selector returns 404, auto-selects if only one DB matches |
When SHOW_DBS: False and multiple databases match DB_FILTER, the server returns a 400 error.
SELF_HOST_UPDATES_URL
Section titled “SELF_HOST_UPDATES_URL”The create-database form offers one optional box, “Email me when there’s a security fix or a new version”. It appears only once the Email field holds a real address, and it starts unticked. If it is ticked, the browser sends that one address to this URL when the database is created. The server itself never contacts it, and nothing is sent when the box is left alone. A failed signup (offline, no internet access) has no effect on the database.
SELF_HOST_UPDATES_URL: "https://fullfinity.com" # defaultSELF_HOST_UPDATES_URL: "" # never offer the boxDB_FILTER
Section titled “DB_FILTER”A regex pattern to filter which databases are available. Supports hostname/subdomain placeholders for multi-tenant setups.
Whatever the filter, only Fullfinity databases are ever listed or served: a database must be
owned by DB_USERNAME and carry Fullfinity’s own tables. On a machine where one Postgres role
also owns another application’s databases, those never appear in the database selector or the
control panel, and a request naming one is refused.
# No filter - every Fullfinity database owned by DB_USERNAME is availableDB_FILTER: None
# Exact matchDB_FILTER: "^mycompany$"
# Prefix matchDB_FILTER: "prod_"
# Subdomain-based filtering (multi-tenant)DB_FILTER: "^%s$"Placeholders:
| Placeholder | Description | Example |
|---|---|---|
%s | First subdomain | acme from acme.example.com |
%h | Full hostname | acme.example.com |
Scheduled jobs follow it too. A server runs scheduled jobs only for the databases its
DB_FILTER matches, so several servers on one host, each pinned to its own database, never run
each other’s jobs. A filter with a placeholder depends on the request’s host, so it cannot narrow
the scheduler: that server runs scheduled jobs for every database owned by DB_USERNAME.
Cache Configuration (Valkey/Redis)
Section titled “Cache Configuration (Valkey/Redis)”VALKEY_HOST: "cache" # Docker service nameVALKEY_PORT: 6379Server Configuration
Section titled “Server Configuration”WORKERS: 2 # Number of Uvicorn workersSERVER_PORT: 8000LOG_LEVEL: "INFO" # DEBUG, INFO, WARNING, ERRORCRON_WORKERS: 1 # Background job workers (0 to disable)Security Configuration
Section titled “Security Configuration”SECRET_KEY: "<a long random value>"REFRESH_SECRET_KEY: "<another long random value>"ACCESS_TOKEN_EXPIRE_HOURS: 6REFRESH_TOKEN_EXPIRE_DAYS: 14Generate each with:
openssl rand -hex 32SECRET_KEY signs everything a visitor holds that the server must later believe — session
tokens, attachment links, the unsubscribe and preference links in campaign mail, page notices,
form proof-of-work challenges — and it is the key behind every Encrypted field and every
per-tenant database password. REFRESH_SECRET_KEY signs refresh tokens.
A link a public page verifies — an attachment link, an unsubscribe or preference link — is signed
with SECRET_KEY narrowed to the database that issued it, so several databases can share one
server and one key: a link issued by one database is refused by every other. A module that signs
its own public links does the same with fullfinity.engine.utils.database_signing_key(), never
SECRET_KEY directly (a test in core refuses the direct read).
Neither has a default, and the server refuses to start without them. fullfinity-server
(and the ASGI app, however it is loaded) exits with a ConfigurationError naming the key when
either is missing, empty, or left at a published placeholder (change-me, CHANGE-ME…,
your-secret-key-here, and the like). There is no development-mode exception: the shipped
deploy stack is the same for development and production, and a placeholder key lets anyone
forge a session.
Signup email screening (DEBOUNCE_KEY)
Section titled “Signup email screening (DEBOUNCE_KEY)”Every public form that opens an account or a demo refuses throwaway email addresses
(mailinator, yopmail and the like): the product’s own self-registration, and any signup page a
module adds through the same check. A short list of well-known throwaway domains is always
checked. Set DEBOUNCE_KEY to a DeBounce API key to also catch the long
tail of throwaway domains:
DEBOUNCE_KEY: "<your DeBounce API key>"- Only DeBounce’s disposable verdict refuses an address. One that bounces, is unknown, or is
a role address such as
info@is allowed — that is a real business, not a throwaway. - A verdict is remembered per email domain, so a run of signups from one company costs one lookup.
- If DeBounce cannot be reached, the key is wrong, or the account is out of credits, signups are allowed (on the list alone) and the reason is logged. Screening never turns a real customer away because of an outage.
- A database that is not live (a copy, or a server with
FULLFINITY_ENVset tostagingortest) screens on the list alone and makes no calls. Thetestcommand makes none either.
Self-registration is also limited to 5 signups per network per hour.
File Storage
Section titled “File Storage”Attachments — every uploaded document, product image and generated PDF — are stored outside the database. By default they are files on the local disk:
FILESTORE_BACKEND: "local" # the defaultFILESTORE_PATH: "/app/filestore" # Inside DockerObject storage
Section titled “Object storage”Local disk cannot be shared between application servers, so an instance running on more than one node — or on a host whose filesystem is ephemeral — stores attachments in an S3-compatible bucket instead:
FILESTORE_BACKEND: "s3"FILESTORE_S3_BUCKET: "my-instance-files"FILESTORE_S3_ENDPOINT: "https://fra1.digitaloceanspaces.com"FILESTORE_S3_REGION: "fra1"FILESTORE_S3_ACCESS_KEY: "..."FILESTORE_S3_SECRET_KEY: "..."This is the S3 API, not a specific vendor: AWS S3, DigitalOcean Spaces, Cloudflare R2,
Backblaze B2, Wasabi, MinIO and Ceph are all supported by pointing FILESTORE_S3_ENDPOINT at
them. Leave the endpoint unset for AWS itself, where it is derived from the region.
| Setting | Notes |
|---|---|
FILESTORE_S3_BUCKET | Required when the backend is s3. Startup fails if it is missing rather than silently writing to local disk. |
FILESTORE_S3_ENDPOINT | Unset for AWS; required for every other provider. |
FILESTORE_S3_REGION | Cloudflare R2 uses auto. |
FILESTORE_S3_ADDRESSING_STYLE | Rarely needed — derived from the endpoint. See below. |
FILESTORE_LOCAL_FALLBACK | Migration only — see below. Off by default. |
FILESTORE_RECLAIM_GRACE_MINUTES | How long deleted bytes are kept before the sweep removes them. 0 (immediate) by default; set it when your database and your files are backed up separately — see below. |
You should not need to set FILESTORE_S3_ADDRESSING_STYLE. S3 lets a request name the bucket
either as a subdomain (bucket.host/key) or as the first path segment (host/bucket/key), and
the two are not interchangeable — the host header is part of what a request signature covers, so
the wrong shape is rejected as a bad signature. Which one works is decided by DNS: a hosted
provider runs a wildcard record so the subdomain resolves, while a MinIO or Ceph endpoint on an IP
address or a bare container name has no such record. The endpoint you configure already says which
case you are in, so the style is derived from it. Set it only for a host that looks like a hosted
provider but is not — an internal, dotted hostname with no wildcard DNS.
FILESTORE_PATH is still used under s3 — for node-local scratch space such as in-progress
data imports — so leave it set and writable.
Module Paths
Section titled “Module Paths”MODULE_PATHS: - "fullfinity/modules" # Built-in modules (inside Docker image) - "fullfinity/enterprise" # Licensed modules (gated at runtime) - "/app/modules" # Your own modules (volume-mounted)Every folder scanned for modules must be listed here — there is no magic default folder. Mount each
of your module folders into the container and add its in-container path as its own line. To load
modules from several separate locations, mount each at a distinct /app/modules/<name> and add one
line per folder.
Multi-Tenant Configuration
Section titled “Multi-Tenant Configuration”For multi-tenant setups, combine SHOW_DBS and DB_FILTER:
SHOW_DBS: FalseDB_FILTER: "^%s$"This configuration:
- Disables the database selector UI
- Routes requests based on subdomain:
acme.example.com→acmedatabasecontoso.example.com→contosodatabase
AI Translations (Optional)
Section titled “AI Translations (Optional)”Fullfinity supports AI-assisted translations for multi-language setups. Set one of:
OPENAI_API_KEY: "sk-..."# orANTHROPIC_API_KEY: "sk-ant-..."Web Push Notifications (Optional)
Section titled “Web Push Notifications (Optional)”Browser web-push (VAPID) is off by default. Provide all three keys to enable it:
VAPID_PUBLIC_KEY: "B...." # served to the browser as applicationServerKeyVAPID_PRIVATE_KEY: "...." # signs each push (keep secret — use config.local.yaml)VAPID_CONTACT_EMAIL: "ops@example.com" # becomes the VAPID "sub" claim (mailto:)- Generate a VAPID key pair once (e.g. with the
py-vapid/web-pushtooling) and reuse it; rotating the public key invalidates existing browser subscriptions. - No-op when unconfigured. If
VAPID_PRIVATE_KEYorVAPID_CONTACT_EMAILis missing, sending a push silently does nothing (it never raises). IfVAPID_PUBLIC_KEYis missing, the frontend simply receives no key and won’t subscribe. VAPID_PRIVATE_KEYis a secret — keep it inconfig.local.yaml, not in the committedconfig.yaml.
Local Overrides and Secrets (config.local.yaml)
Section titled “Local Overrides and Secrets (config.local.yaml)”A sibling *.local.yaml file (e.g. config.local.yaml next to config.yaml), if present, is merged over the base config at the top level when the config is loaded. It is gitignored, so secrets — SECRET_KEY, REFRESH_SECRET_KEY, DB_PASSWORD, OPENAI_API_KEY, etc. — can live there instead of in the committed config.yaml. Keys in the local file override the base file.
# config.local.yaml (gitignored)DB_PASSWORD: "real-password"SECRET_KEY: "..."REFRESH_SECRET_KEY: "..."An Enterprise license is activated in the app (Settings → License) and stored in the database, not in a config file, so it can be moved, renewed and revoked without anyone editing a file on the server.
Environment variables
Section titled “Environment variables”In the container image, any UPPERCASE environment variable overrides the config key of the same
name: on every start the image writes them into config.local.yaml, which is merged over
config.yaml. This is how the Compose files set DB_HOST, VALKEY_HOST and MODULE_PATHS, and
it means a key set in the environment wins over the same key in config.yaml. A list value is
written as a YAML flow list (MODULE_PATHS: '["fullfinity/modules", "/app/modules"]').
Outside the container image only config.yaml and config.local.yaml apply. Two variables are
read from the process environment directly: FULLFINITY_CONFIG_PATH, the path to the config file
(the CLI sets it from -c/--config so worker processes can find it), and FULLFINITY_ENV, which
marks a process as non-production and wins over the config key of that name.
Built-in Defaults
Section titled “Built-in Defaults”When a key is absent everywhere, the engine falls back to its own default:
| Setting | Built-in default | Compose stack (config.example.yaml) |
|---|---|---|
DB_HOST | localhost | db |
VALKEY_HOST | localhost | cache |
FILESTORE_PATH | filestore/ | /app/filestore |
FILESTORE_BACKEND | local | local |
MODULE_PATHS | fullfinity/modules, fullfinity/enterprise | the same, plus /app/modules |
Next Steps
Section titled “Next Steps”- Quick Start — Create your first module
- CLI Reference — Server and module management commands