Back to Ferretdb

Configuration flags

website/docs/configuration/flags.md

2.7.08.2 KB
Original Source

Configuration flags

FerretDB provides numerous configuration flags you can customize to suit your needs and environment. You can always see the complete list by using --help flag. To make user experience cloud native, every flag has its environment variable equivalent. There is no configuration file.

:::info Some default values are overridden in our Docker image. :::

<!-- Keep order in sync with the `--help` output -->

General

FlagDescriptionEnvironment VariableDefault Value
-h, --helpShow context-sensitive help
--versionPrint version to stdout and exit

PostgreSQL

FlagDescriptionEnvironment VariableDefault Value
--postgresql-urlPostgreSQL connection URLFERRETDB_POSTGRESQL_URLpostgres://127.0.0.1:5432/postgres
--postgresql-url-filePath to a file containing the PostgreSQL connection URL. If non-empty, this overrides --postgresql-url.FERRETDB_POSTGRESQL_URL_FILE

FerretDB uses pgx v5 library for connecting to PostgreSQL. Supported URL query parameters and default values are documented there:

Additionally:

  • pool_min_conns is set to 10 if unset (overriding pgx's value of 0);
  • pool_max_conns is set to 50 if unset (overriding pgx's value of 4);
  • application_name is always set to "FerretDB";
  • timezone is always set to "UTC".

Interfaces

FlagDescriptionEnvironment VariableDefault Value
--listen-addrListen TCP address for MongoDB protocol
(set to empty value or - to disable)FERRETDB_LISTEN_ADDR127.0.0.1:27017
(:27017 for Docker)
--listen-unixListen Unix domain socket path for MongoDB protocol
(set to empty value or - to disable)FERRETDB_LISTEN_UNIX
--listen-tlsListen TLS address for MongoDB protocol (see here)
(set to empty value or - to disable)FERRETDB_LISTEN_TLS
--listen-tls-cert-fileTLS cert file pathFERRETDB_LISTEN_TLS_CERT_FILE
--listen-tls-key-fileTLS key file pathFERRETDB_LISTEN_TLS_KEY_FILE
--listen-tls-ca-fileTLS CA file pathFERRETDB_LISTEN_TLS_CA_FILE
--listen-data-api-addrListen TCP address for HTTP Data API
(set to empty value or - to disable)FERRETDB_LISTEN_DATA_API_ADDR
--listen-mcp-addrListen TCP address for HTTP MCP server
(set to empty value or - to disable)FERRETDB_LISTEN_MCP_ADDR
--proxy-addrProxy address for non-normal operation modeFERRETDB_PROXY_ADDR
--proxy-tls-cert-fileProxy TLS cert file pathFERRETDB_PROXY_TLS_CERT_FILE
--proxy-tls-key-fileProxy TLS key file pathFERRETDB_PROXY_TLS_KEY_FILE
--proxy-tls-ca-fileProxy TLS CA file pathFERRETDB_PROXY_TLS_CA_FILE
--debug-addrListen address for HTTP handlers for metrics, pprof, etc
(set to empty value or - to disable)FERRETDB_DEBUG_ADDR127.0.0.1:8088
(:8088 for Docker)

Miscellaneous

FlagDescriptionEnvironment VariableDefault Value
--modeOperation modeFERRETDB_MODEnormal
--state-dirPath to the FerretDB state directoryFERRETDB_STATE_DIR.
(/state for Docker)
--[no-]authEnable authenticationFERRETDB_AUTHenabled
--log-levelLog level: 'debug', 'info', 'warn', 'error'FERRETDB_LOG_LEVELinfo
--[no-]log-uuidAdd instance UUID to all log messagesFERRETDB_LOG_UUIDdisabled
--[no-]metrics-uuidAdd instance UUID to all metricsFERRETDB_METRICS_UUIDdisabled
--otel-service-nameOpenTelemetry service nameFERRETDB_OTEL_SERVICE_NAMEferretdb
--otel-traces-urlOpenTelemetry OTLP/HTTP traces endpoint URL (e.g. http://host:4318/v1/traces)
(set to empty value or - to disable)FERRETDB_OTEL_TRACES_URLdisabled
--telemetryEnable or disable basic telemetryFERRETDB_TELEMETRYundecided
<!-- Do not document `--dev-XXX` flags -->