Jump to
↵select↑↓navigateescclose

Reference

services.frappe options

Every option of the frappe-nix NixOS module, at the top level and per site, with types and defaults.

Updated
Tags
  • options
  • reference
  • nixos
On this page

These are the options of nixosModules.default, the NixOS module that deploys a built bench. The types and defaults were checked against the module by evaluating it. For how the pieces work together, see Run Frappe as a NixOS service and Operate a deployed site.

Top-level options

These sit directly under services.frappe.

OptionTypeDefaultNotes
enableboolfalseEnable the Frappe production deployment (systemd).
packagepackagerequiredThe default bench package: builtBench, or packages.default of a bench repository. Sites inherit it unless they set their own.
userstr"frappe"The service user. The module creates it only when the name is frappe.
groupstr"frappe"The service group. The module creates it only when the name is frappe.
extraEnvattrs of str{ }Extra environment variables for all Frappe services.
extraPathlist of package[ ]Extra packages on the units' PATH. systemd's path sets PATH to exactly the listed packages, so a package that is only in environment.systemPackages is invisible to these services. The module already includes git, gzip, tar, bash and the MariaDB client tools that Frappe's backup code needs.
workerslist of str[ "default" "short" "long" ]Background worker queues per site. Under the unified runtime they are passed to the runner as --queue instead of becoming one unit each.
web.workersint4Number of gunicorn workers, shared across sites. Ignored when runtime.enable is on, with a warning when it is not at its default.
database.createLocallyboolfalseEnable a local MariaDB. Aggregate: it is on if this or any site requests it.
database.packagepackagepkgs.mariadbThe MariaDB package. Its client library is on LD_LIBRARY_PATH.
redis.createLocallyboolfalseRun a local Redis instance, named frappe, unit redis-frappe.
redis.portport13000The port of that Redis. The sites' Redis URLs default to a fixed string and do not follow it.
runtime.enablebooltrueOne frappe-runtime unit per site (web, realtime, jobs and scheduler) instead of separate web, socketio, worker and scheduler units. Needs frappe-runtime in the bench's Python environment.
runtime.jobThreadsint4Concurrent background jobs inside the runtime process.
runtime.webThreadsint0Concurrent web requests. 0 keeps frappe_runtime.asgi's own default (FRAPPE_WEB_THREADS, itself defaulting to 8). Size the database pool against it.
runtime.restartAfterRequestsint5000Web requests before a graceful restart. 0 means never.
runtime.restartAfterJobsint500Background jobs before a graceful restart. 0 means never.
runtime.restartIdleSecondsint300Idle seconds before a graceful restart. 0 means never.
runtime.requestDrainSecondsint60How long a graceful stop waits for in-flight web requests.
runtime.jobDrainSecondsint600How long a graceful stop waits for a job in progress. TimeoutStopSec is derived from this and requestDrainSeconds, so systemd outlasts the drain instead of killing the process partway through.
runtime.extraArgslist of str[ ]Extra arguments appended to the frappe-runtime command line.
logging.leveldebug, info, warning or error"warning"Threshold for Frappe's application loggers and bench's own log (FRAPPE_LOG_LEVEL). See Logging.
logging.accessLogbooltruenginx's access log to the journal as JSON, one object per request. false turns access logging off for every virtual host on the machine.
migrate.enablebooltrueRun bench migrate automatically per site when a new build is deployed.
migrate.snapshotbooltrueTake a mysqldump snapshot before migrating, as a safety net.
migrate.rollbackOnFailurebooltrueRestore the snapshot if the migration fails. No effect when snapshot is off.
migrate.maintenanceModebooltrueToggle maintenance mode around the migration. It is left on if the migration fails.
migrate.snapshotRetentionpositive int3Snapshots to keep per site under <siteDir>/snapshots.
migrate.offline.enableboolfalseAlter large tables online before bench migrate, inside the same snapshot and maintenance mode. See Migrate large tables online.
migrate.offline.rowThresholdunsigned int100000Rows at which a table is altered online rather than by bench migrate itself. 0 sends every table with a pending change through it.

Per-site options

These sit under services.frappe.sites.<NAME>, where <NAME> is the site name.

OptionTypeDefaultNotes
enableboolfalseEnable this site.
packagepackage or nullnullPer-site bench package override. Defaults to services.frappe.package.
siteDirstr"/var/lib/frappe/<NAME>"The state directory for this site.
web.portport8000The listen port of the runtime or gunicorn. Ignored when web.socketPath is set.
web.socketPathstr""A unix socket instead of a TCP port. nginx reaches it through a generated upstream. The directory must not be /run itself: see Run Frappe as a NixOS service.
socketio.portport9000The Node realtime server port. Only with runtime.enable = false, and ignored when socketio.socketPath is set.
socketio.socketPathstr""A unix socket for the realtime server (socketio_uds). Needs Frappe 15.46 or newer. Only with runtime.enable = false; with the runtime it is ignored, with a warning.
database.createLocallyboolfalseCreate a local MariaDB database and user for this site.
database.hoststr"127.0.0.1"The database host, used when socket is empty.
database.portport3306The database port, used when socket is empty.
database.socketstr"/run/mysqld/mysqld.sock"The database unix socket. Empty disables socket authentication and makes Frappe use host and port.
database.namestrthe site nameThe database name, defaulting to the site name with dots and hyphens replaced by underscores.
database.userstrthe site nameThe database user, defaulting the same way.
database.passwordFilepath or nullnullA file containing the database password. Merged into site_config.json at activation.
redis.cacheUrlstr"redis://127.0.0.1:13000"The Redis cache URL.
redis.queueUrlstr"redis://127.0.0.1:13000"The Redis queue URL.
redis.socketioUrlstr"redis://127.0.0.1:13000"The Redis URL for realtime.
encryptionKeyFilepath or nullnullA file containing the Frappe encryption key. Merged into site_config.json at activation.
extraConfigattrs{ }Extra keys merged into the base site_config.json. Nix values, no secrets.
extraConfigFileslist of path[ ]JSON files deep-merged into site_config.json at activation. This is the place for secrets such as object-storage credentials.
nginx.enableboolfalseCreate an nginx virtual host for this site.
nginx.socketPathstr""Also serve the virtual host on a unix socket, for a co-located reverse proxy or tunnel connector that terminates TLS elsewhere. The client address then comes from CF-Connecting-IP. Requires nginx.enable.