Files
FerretDB/website/docs/configuration/flags.md
T
2025-11-06 09:08:44 +04:00

8.2 KiB

sidebar_position
sidebar_position
1

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. :::

General

Flag Description Environment Variable Default Value
-h, --help Show context-sensitive help
--version Print version to stdout and exit

PostgreSQL

Flag Description Environment Variable Default Value
--postgresql-url PostgreSQL connection URL FERRETDB_POSTGRESQL_URL postgres://127.0.0.1:5432/postgres
--postgresql-url-file Path 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

Flag Description Environment Variable Default Value
--listen-addr Listen TCP address for MongoDB protocol
(set to empty value or - to disable)
FERRETDB_LISTEN_ADDR 127.0.0.1:27017
(:27017 for Docker)
--listen-unix Listen Unix domain socket path for MongoDB protocol
(set to empty value or - to disable)
FERRETDB_LISTEN_UNIX
--listen-tls Listen TLS address for MongoDB protocol (see here)
(set to empty value or - to disable)
FERRETDB_LISTEN_TLS
--listen-tls-cert-file TLS cert file path FERRETDB_LISTEN_TLS_CERT_FILE
--listen-tls-key-file TLS key file path FERRETDB_LISTEN_TLS_KEY_FILE
--listen-tls-ca-file TLS CA file path FERRETDB_LISTEN_TLS_CA_FILE
--listen-data-api-addr Listen TCP address for HTTP Data API
(set to empty value or - to disable)
FERRETDB_LISTEN_DATA_API_ADDR
--listen-mcp-addr Listen TCP address for HTTP MCP server
(set to empty value or - to disable)
FERRETDB_LISTEN_MCP_ADDR
--proxy-addr Proxy address for non-normal operation mode FERRETDB_PROXY_ADDR
--proxy-tls-cert-file Proxy TLS cert file path FERRETDB_PROXY_TLS_CERT_FILE
--proxy-tls-key-file Proxy TLS key file path FERRETDB_PROXY_TLS_KEY_FILE
--proxy-tls-ca-file Proxy TLS CA file path FERRETDB_PROXY_TLS_CA_FILE
--debug-addr Listen address for HTTP handlers for metrics, pprof, etc
(set to empty value or - to disable)
FERRETDB_DEBUG_ADDR 127.0.0.1:8088
(:8088 for Docker)

Miscellaneous

Flag Description Environment Variable Default Value
--mode Operation mode FERRETDB_MODE normal
--state-dir Path to the FerretDB state directory FERRETDB_STATE_DIR .
(/state for Docker)
--[no-]auth Enable authentication FERRETDB_AUTH enabled
--log-level Log level: 'debug', 'info', 'warn', 'error' FERRETDB_LOG_LEVEL info
--[no-]log-uuid Add instance UUID to all log messages FERRETDB_LOG_UUID disabled
--[no-]metrics-uuid Add instance UUID to all metrics FERRETDB_METRICS_UUID disabled
--otel-service-name OpenTelemetry service name FERRETDB_OTEL_SERVICE_NAME ferretdb
--otel-traces-url OpenTelemetry OTLP/HTTP traces endpoint URL (e.g. http://host:4318/v1/traces)
(set to empty value or - to disable)
FERRETDB_OTEL_TRACES_URL disabled
--telemetry Enable or disable basic telemetry FERRETDB_TELEMETRY undecided