Configuration reference

The environment variables that matter: secrets, database, storage, email, sign-up, limits.

This page lists the settings of a self-hosted mlflow server. Read the next section first, because it explains which settings you can change in a stack made by the installer.

How settings reach the application

Every setting is an environment variable whose name starts with MLFLOW_, for example MLFLOW_SMTP_HOST. An installed stack reads them from two files in /opt/mlflow, both readable by root only:

  • .env holds what the installer manages: the domain, the versions, the ports and the generated secrets. You rarely edit it.
  • config.env holds your optional advanced settings. The installer creates it from a template in which every supported setting is listed and commented out. Uncomment and edit only what you need.

Values in config.env are passed to the application and the worker, and take precedence over the defaults the installer sets. Upgrades never overwrite the file.

bash
sudo mlflowctl config edit       # opens config.env in $EDITOR, then checks it
sudo mlflowctl config validate   # checks it: unknown names, wrong value types
sudo mlflowctl config apply      # validates, then recreates the application and worker

validate warns about a name it does not know and suggests the closest supported one ("did you mean MLFLOW_SMTP_HOST?"). It reports an error for a value of the wrong kind, such as text where a number is expected. apply refuses to change anything while there are errors.

Variable in .envMeaningSet by
MLFLOW_DOMAINThe public address, the allowed web origin and the email link baseThe installer, from --domain
MLFLOW_ACME_EMAILContact address for the HTTPS certificateThe installer
MLFLOW_ADMIN_EMAILA record of the first administrator's emailThe installer
MLFLOW_VERSION, MLFLOW_REGISTRYWhich images run, and where they come fromThe installer and mlflowctl upgrade
MLFLOW_PG_PASSWORDThe database passwordGenerated once
MLFLOW_JWT_SECRET, MLFLOW_SECRETS_KEYThe signing secret and the encryption key (see below)Generated once
MLFLOW_HTTP_PORT, MLFLOW_HTTPS_PORTThe ports published by CaddyDefault 80 and 443

Do not repeat these in config.env: validate warns when you do. The email settings (MLFLOW_SMTP_*) may live in either file; if a name appears in both, config.env wins.

On a stack you assemble yourself, for example on Kubernetes, set the same MLFLOW_ variables in the container environment.

Required secrets

A production server refuses to start unless it has strong secrets. Both are generated for you by the installer.

SettingPurposeRules
MLFLOW_JWT_SECRETSigns the sign-in tokens.At least 32 characters. The built-in development default and obvious placeholders are rejected. The installer creates 64 random hexadecimal characters.
MLFLOW_SECRETS_KEYEncrypts stored credentials: AI provider keys and database passwords of connections.A Fernet key (32 random bytes, URL-safe base64). Required in production.
MLFLOW_ENVIRONMENTdev, staging or prod.With prod, the checks above and the email checks below are enforced at start-up. The installer sets prod.

Keep the encryption key with your backups

Stored credentials can only be read with the key that encrypted them. If you restore a database without the original MLFLOW_SECRETS_KEY , every saved connection password and AI provider key becomes unreadable. Back up /opt/mlflow/.env (and config.env) separately from the data. Changing the sign-in secret signs everyone out, because tokens signed with the old secret stop being valid.

Generate a signing secret and an encryption key with:

bash
python -c "import secrets; print(secrets.token_hex(32))"
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Database and queue

SettingDefaultMeaning
MLFLOW_DATABASE_URLA local SQLite fileThe database address. Use PostgreSQL for a production server, for example postgresql+psycopg://user:password@host:5432/mlflow.
MLFLOW_RUNS_BACKENDinprocessinprocess runs training inside the web process, which suits only a single-user test. redis sends jobs to separate workers through a queue.
MLFLOW_REDIS_URLredis://localhost:6379/0Address of the queue when the backend is redis.
MLFLOW_WORKER_QUEUESdefaultThe queues that a worker takes jobs from.

The installer's stack uses PostgreSQL 16 (database and user both named mlflow) and Redis 7 in containers, with the redis queue backend, one worker, and the database password you never need to know. A single migration job runs before the application and the worker start, so an empty database never serves traffic.

Artifact storage

Datasets, trained models and run outputs are stored as artifacts.

SettingDefaultMeaning
MLFLOW_STORAGE_BACKENDlocallocal stores files on disk. s3 stores them in an S3 bucket or an S3-compatible service.
MLFLOW_ARTIFACT_DIRA folder next to the serverFor local storage: where files go. The installer uses /data/artifacts on a Docker volume shared by the application and the worker.
MLFLOW_STORAGE_BUCKETnoneFor s3: the bucket name.
MLFLOW_STORAGE_REGIONus-east-1For s3: the region.
MLFLOW_STORAGE_ACCESS_KEY, MLFLOW_STORAGE_SECRET_KEYnoneFor s3: the credentials.
MLFLOW_STORAGE_ENDPOINT_URLnoneFor an S3-compatible service such as MinIO or Cloudflare R2: its address.
MLFLOW_STORAGE_PUBLIC_ENDPOINT_URLnoneThe address browsers can reach, if it differs. Without it, the server streams downloads itself.

The container user (ID 10001) must own the artifacts folder. The default Docker volume already does. Back up artifacts together with the database.

Email

Email is used for password resets, invitations, verification links and alerts. It is off until you set a host.

SettingDefaultMeaning
MLFLOW_SMTP_HOSTnoneThe mail server. Email stays off while this is empty.
MLFLOW_SMTP_PORT587The mail server port.
MLFLOW_SMTP_USE_TLStrueUse STARTTLS (normally with port 587).
MLFLOW_SMTP_SSLfalseUse implicit TLS instead (normally with port 465).
MLFLOW_SMTP_USERNAME, MLFLOW_SMTP_PASSWORDnoneMail server login.
MLFLOW_SMTP_FROMnoneThe sender address.
MLFLOW_SMTP_FROM_NAMEmlflowA display name added to a bare sender address.
MLFLOW_PUBLIC_BASE_URLnoneThe public address of the web app. Links in emails are built from it.

Account emails work only when both the host and MLFLOW_PUBLIC_BASE_URL are set. A production server refuses to start with a host but no base URL. The installer sets the base URL to https://<your domain>. On an installed server, add these lines to config.env, then run sudo mlflowctl config apply:

/opt/mlflow/config.env
MLFLOW_SMTP_HOST=smtp.example.com
MLFLOW_SMTP_PORT=587
MLFLOW_SMTP_USERNAME=mailer
MLFLOW_SMTP_PASSWORD=<password>
MLFLOW_SMTP_FROM=mlflow@example.com

Sign-up and verification

SettingDefaultMeaning
MLFLOW_ALLOW_PUBLIC_SIGNUPfalseLets visitors create their own account on the sign-up page. By default only administrators add people. The installer keeps it false.
MLFLOW_REQUIRE_EMAIL_VERIFICATIONFollows public sign-upMakes new accounts verify their address. It is on only if public sign-up is on, unless you set it.
MLFLOW_EMAIL_VERIFICATION_TTL_HOURS24How long a verification link works (1 to 168).
MLFLOW_PASSWORD_RESET_TTL_MINUTES30How long a password-reset link works (5 to 1440).
MLFLOW_PROJECT_DEFAULT_ROLEeditorThe role workspace members get on a project where they have no explicit role: none, viewer or editor. none makes projects private to their members.
MLFLOW_ACCESS_TOKEN_TTL_MINUTES, MLFLOW_REFRESH_TOKEN_TTL_DAYS60 and 30How long a sign-in lasts without activity and in total.

The first administrator is created during installation. On a server you assemble yourself, the first visit to the web app opens a setup page, Welcome to mlflow, where you enter the admin email, a password of at least 8 characters, a display name and a workspace name.

Verification needs working email. A production server with verification on and no email configured refuses to start. See Your account for what people see.

Limits and rate limits

Plan limits do not apply to a self-hosted server: every workspace is unlimited. The settings below protect the server itself. A value of 0 turns off the matching limit, except where noted.

Size limits

SettingDefaultLimits
MLFLOW_BATCH_MAX_UPLOAD_BYTES64 MiBA file uploaded for batch predictions.
MLFLOW_BATCH_MAX_ROWS, MLFLOW_BATCH_MAX_COLUMNS1,000,000 and 5,000Rows and columns of a batch file.
MLFLOW_UPLOAD_MAX_ROWS10,000,000Rows of a dataset upload.
MLFLOW_UPLOAD_MAX_DECOMPRESSED_BYTES1 GiBSize of a compressed upload (Excel, Parquet) after unpacking.
MLFLOW_SQL_QUERY_MAX_ROWS1,000,000Rows a database query can return.
MLFLOW_SQL_QUERY_TIMEOUT_SECONDS120Time allowed for one query.
MLFLOW_SQL_CONNECT_TIMEOUT_SECONDS10Time allowed to connect.

Rate limits

Requests over a limit get status 429 with a Retry-After header. See Errors and rate limits.

SettingDefaultLimits
MLFLOW_RATE_LIMIT_ENABLEDtrueThe switch for the limits on the public account routes (sign-in, sign-up and similar).
MLFLOW_RATE_LIMIT_LOGIN_IP, ..._LOGIN_EMAIL, ..._LOGIN_WINDOW_SECONDS10, 5 and 60Sign-in attempts per address and per email in a window.
MLFLOW_RATE_LIMIT_SIGNUP_IP, ..._SIGNUP_WINDOW_SECONDS5 and 3600Sign-ups per address.
MLFLOW_RATE_LIMIT_API_KEY, ..._API_KEY_WINDOW_SECONDS600 and 60Requests per API key.
MLFLOW_RATE_LIMIT_PUBLIC_PREDICT_IP, ..._WINDOW_SECONDS60 and 60Calls to a public endpoint from outside its workspace, per address and endpoint.
MLFLOW_RATE_LIMIT_LLM_USER, ..._WINDOW_SECONDS30 and 300AI advisor calls per person.
MLFLOW_MONITOR_INGEST_RECORDS_PER_MINUTE12,000Records one external deployment may send per minute.

The limits keep their counters in memory, or in Redis when the queue backend is redis, so they are shared by all application processes. Limits per address depend on the real client address. See Domains, TLS and reverse proxies.

Network egress

People with access can connect mlflow to databases and web services, and to an AI provider with a custom address. By default the server only connects to public addresses. Private networks, loopback (localhost) and cloud metadata addresses are refused, so a member cannot use the server to probe your internal network.

SettingDefaultMeaning
MLFLOW_ALLOW_PRIVATE_EGRESSfalseAllow private (10.x, 172.16-31.x, 192.168.x, 100.64.x) and loopback destinations. Turn it on when your databases or a local AI service run on your own network.
MLFLOW_EGRESS_ALLOWED_HOSTSemptyAllow only some destinations: a comma-separated list of host names, *.suffix patterns, IP addresses and CIDR ranges. It works with the switch above off. A listed name is trusted with whatever it resolves to, so list only names whose DNS you control, and prefer CIDR ranges.
MLFLOW_HTTP_CONNECTOR_METHODSGETThe request methods the HTTP connector may send. Add POST for services that take a query in the body.
MLFLOW_BIGQUERY_ALLOW_ADCfalseLets BigQuery connections without a key use the server's own Google identity.
MLFLOW_BIGQUERY_ADC_PROJECTSemptyWhen the option above is on, limits it to these projects (comma-separated; empty means any).

Link-local and cloud-metadata addresses stay blocked unless you list them explicitly. The HTTP connector and the AI client ignore the HTTP_PROXY and ALL_PROXY variables, because a proxy would connect past these checks. The server needs direct outbound access to the hosts it should reach. Turn on private egress only if every workspace member may reach those internal systems.

Other settings

SettingDefaultMeaning
MLFLOW_CORS_ORIGINSLocal development addressesThe web origins allowed to call the API from a browser, as a JSON list. See Domains, TLS and reverse proxies.
MLFLOW_TRUST_FORWARDED_FOR, MLFLOW_FORWARDED_FOR_HOPSfalse and 1How the real client address is read behind proxies. The installer sets true and 2.
MLFLOW_PUBLIC_URLThe request hostThe address used to build the monitor URL shown for external deployments.
MLFLOW_ENABLE_DEPLOYMENTStrueServes models from this server.
MLFLOW_MCP_ENABLEDfalseTurns on the remote MCP server at /mcp.

Next steps

Updated 2026-11-22