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:
.envholds what the installer manages: the domain, the versions, the ports and the generated secrets. You rarely edit it.config.envholds 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.
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 workervalidate 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 .env | Meaning | Set by |
|---|---|---|
MLFLOW_DOMAIN | The public address, the allowed web origin and the email link base | The installer, from --domain |
MLFLOW_ACME_EMAIL | Contact address for the HTTPS certificate | The installer |
MLFLOW_ADMIN_EMAIL | A record of the first administrator's email | The installer |
MLFLOW_VERSION, MLFLOW_REGISTRY | Which images run, and where they come from | The installer and mlflowctl upgrade |
MLFLOW_PG_PASSWORD | The database password | Generated once |
MLFLOW_JWT_SECRET, MLFLOW_SECRETS_KEY | The signing secret and the encryption key (see below) | Generated once |
MLFLOW_HTTP_PORT, MLFLOW_HTTPS_PORT | The ports published by Caddy | Default 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.
| Setting | Purpose | Rules |
|---|---|---|
MLFLOW_JWT_SECRET | Signs 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_KEY | Encrypts stored credentials: AI provider keys and database passwords of connections. | A Fernet key (32 random bytes, URL-safe base64). Required in production. |
MLFLOW_ENVIRONMENT | dev, 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:
python -c "import secrets; print(secrets.token_hex(32))"
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"Database and queue
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_DATABASE_URL | A local SQLite file | The database address. Use PostgreSQL for a production server, for example postgresql+psycopg://user:password@host:5432/mlflow. |
MLFLOW_RUNS_BACKEND | inprocess | inprocess runs training inside the web process, which suits only a single-user test. redis sends jobs to separate workers through a queue. |
MLFLOW_REDIS_URL | redis://localhost:6379/0 | Address of the queue when the backend is redis. |
MLFLOW_WORKER_QUEUES | default | The 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.
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_STORAGE_BACKEND | local | local stores files on disk. s3 stores them in an S3 bucket or an S3-compatible service. |
MLFLOW_ARTIFACT_DIR | A folder next to the server | For local storage: where files go. The installer uses /data/artifacts on a Docker volume shared by the application and the worker. |
MLFLOW_STORAGE_BUCKET | none | For s3: the bucket name. |
MLFLOW_STORAGE_REGION | us-east-1 | For s3: the region. |
MLFLOW_STORAGE_ACCESS_KEY, MLFLOW_STORAGE_SECRET_KEY | none | For s3: the credentials. |
MLFLOW_STORAGE_ENDPOINT_URL | none | For an S3-compatible service such as MinIO or Cloudflare R2: its address. |
MLFLOW_STORAGE_PUBLIC_ENDPOINT_URL | none | The 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 is used for password resets, invitations, verification links and alerts. It is off until you set a host.
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_SMTP_HOST | none | The mail server. Email stays off while this is empty. |
MLFLOW_SMTP_PORT | 587 | The mail server port. |
MLFLOW_SMTP_USE_TLS | true | Use STARTTLS (normally with port 587). |
MLFLOW_SMTP_SSL | false | Use implicit TLS instead (normally with port 465). |
MLFLOW_SMTP_USERNAME, MLFLOW_SMTP_PASSWORD | none | Mail server login. |
MLFLOW_SMTP_FROM | none | The sender address. |
MLFLOW_SMTP_FROM_NAME | mlflow | A display name added to a bare sender address. |
MLFLOW_PUBLIC_BASE_URL | none | The 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:
MLFLOW_SMTP_HOST=smtp.example.com
MLFLOW_SMTP_PORT=587
MLFLOW_SMTP_USERNAME=mailer
MLFLOW_SMTP_PASSWORD=<password>
MLFLOW_SMTP_FROM=mlflow@example.comSign-up and verification
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_ALLOW_PUBLIC_SIGNUP | false | Lets visitors create their own account on the sign-up page. By default only administrators add people. The installer keeps it false. |
MLFLOW_REQUIRE_EMAIL_VERIFICATION | Follows public sign-up | Makes new accounts verify their address. It is on only if public sign-up is on, unless you set it. |
MLFLOW_EMAIL_VERIFICATION_TTL_HOURS | 24 | How long a verification link works (1 to 168). |
MLFLOW_PASSWORD_RESET_TTL_MINUTES | 30 | How long a password-reset link works (5 to 1440). |
MLFLOW_PROJECT_DEFAULT_ROLE | editor | The 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_DAYS | 60 and 30 | How 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
| Setting | Default | Limits |
|---|---|---|
MLFLOW_BATCH_MAX_UPLOAD_BYTES | 64 MiB | A file uploaded for batch predictions. |
MLFLOW_BATCH_MAX_ROWS, MLFLOW_BATCH_MAX_COLUMNS | 1,000,000 and 5,000 | Rows and columns of a batch file. |
MLFLOW_UPLOAD_MAX_ROWS | 10,000,000 | Rows of a dataset upload. |
MLFLOW_UPLOAD_MAX_DECOMPRESSED_BYTES | 1 GiB | Size of a compressed upload (Excel, Parquet) after unpacking. |
MLFLOW_SQL_QUERY_MAX_ROWS | 1,000,000 | Rows a database query can return. |
MLFLOW_SQL_QUERY_TIMEOUT_SECONDS | 120 | Time allowed for one query. |
MLFLOW_SQL_CONNECT_TIMEOUT_SECONDS | 10 | Time allowed to connect. |
Rate limits
Requests over a limit get status 429 with a Retry-After header. See Errors and rate limits.
| Setting | Default | Limits |
|---|---|---|
MLFLOW_RATE_LIMIT_ENABLED | true | The switch for the limits on the public account routes (sign-in, sign-up and similar). |
MLFLOW_RATE_LIMIT_LOGIN_IP, ..._LOGIN_EMAIL, ..._LOGIN_WINDOW_SECONDS | 10, 5 and 60 | Sign-in attempts per address and per email in a window. |
MLFLOW_RATE_LIMIT_SIGNUP_IP, ..._SIGNUP_WINDOW_SECONDS | 5 and 3600 | Sign-ups per address. |
MLFLOW_RATE_LIMIT_API_KEY, ..._API_KEY_WINDOW_SECONDS | 600 and 60 | Requests per API key. |
MLFLOW_RATE_LIMIT_PUBLIC_PREDICT_IP, ..._WINDOW_SECONDS | 60 and 60 | Calls to a public endpoint from outside its workspace, per address and endpoint. |
MLFLOW_RATE_LIMIT_LLM_USER, ..._WINDOW_SECONDS | 30 and 300 | AI advisor calls per person. |
MLFLOW_MONITOR_INGEST_RECORDS_PER_MINUTE | 12,000 | Records 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.
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_ALLOW_PRIVATE_EGRESS | false | Allow 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_HOSTS | empty | Allow 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_METHODS | GET | The request methods the HTTP connector may send. Add POST for services that take a query in the body. |
MLFLOW_BIGQUERY_ALLOW_ADC | false | Lets BigQuery connections without a key use the server's own Google identity. |
MLFLOW_BIGQUERY_ADC_PROJECTS | empty | When 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
| Setting | Default | Meaning |
|---|---|---|
MLFLOW_CORS_ORIGINS | Local development addresses | The 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_HOPS | false and 1 | How the real client address is read behind proxies. The installer sets true and 2. |
MLFLOW_PUBLIC_URL | The request host | The address used to build the monitor URL shown for external deployments. |
MLFLOW_ENABLE_DEPLOYMENTS | true | Serves models from this server. |
MLFLOW_MCP_ENABLED | false | Turns on the remote MCP server at /mcp. |
Next steps
Updated 2026-11-22