# Self-Hosting MLflow

> #### ***The most vendor-neutral MLOps/LLMOps platform in the world.***[​](#the-most-vendor-neutral-mlopsllmops-platform-in-the-world "Direct link to the-most-vendor-neutral-mlopsllmops-platform-in-the-world")

MLflow is fully open-source. Thousands of users and organizations run their own MLflow instances to meet their specific needs. Being open-source and trusted by the popular cloud providers, MLflow is the best choice for teams/organizations that worry about vendor lock-in.

Default Storage Backend Change

As of MLflow 3.7.0, the default tracking backend has changed from file-based storage (`./mlruns`) to SQLite database (`sqlite:///mlflow.db`) for better performance and reliability.

**Existing users:** If you have existing data in `./mlruns`, MLflow will automatically detect and continue using it. No action is required.

**New users:** New MLflow servers will use SQLite by default. To use file-based storage instead, set `MLFLOW_TRACKING_URI=./mlruns` or specify `--backend-store-uri ./mlruns` when starting the server.

For more details and migration guidance, see [GitHub Issue #18534](https://github.com/mlflow/mlflow/issues/18534).

## The Quickest Path: Run `mlflow` Command[​](#the-quickest-path-run-mlflow-command "Direct link to the-quickest-path-run-mlflow-command")

The easiest way to start MLflow server is to run the `mlflow` CLI command in your terminal. This is suitable for personal use or small teams.

First, install MLflow with:

bash

```
pip install mlflow
```

info

See [Secure Installs](/docs/latest/self-hosting/security/secure-installs.md) to learn how to pin dependencies to known good versions using hash checking and upload-time filtering.

Then, start the server with:

bash

```
mlflow server --port 5000
```

This will start the server and UI at `http://localhost:5000` using SQLite as the backend store (the default). You can connect the client to the server by setting the tracking URI:

python

```
import mlflow



mlflow.set_tracking_uri("http://localhost:5000")



# Start tracking!

# Open http://localhost:5000 in your browser to view the UI.
```

Now, you are ready to start your experiment!

* [Tracing QuickStart](/docs/latest/genai/tracing/quickstart.md)
* [LLM Evaluation Quickstart](/docs/latest/genai/eval-monitor/quickstart.md)
* [Prompt Management Quickstart](/docs/latest/genai/prompt-registry.md#getting-started)
* [Model Training Quickstart](/docs/latest/ml/tracking/quickstart.md)

tip

For production deployments or custom backend configurations, see [Backend Store](/docs/latest/self-hosting/architecture/backend-store.md) documentation.

## Other Deployment Options[​](#other-deployment-options "Direct link to Other Deployment Options")

### Docker Compose[​](#docker-compose "Direct link to Docker Compose")

The MLflow repository includes a ready-to-run Compose project under `docker-compose/` that provisions MLflow, PostgreSQL, and [RustFS](https://github.com/rustfs/rustfs).

bash

```
git clone https://github.com/mlflow/mlflow.git

cd mlflow/docker-compose

cp .env.dev.example .env

docker compose up -d

# Open http://localhost:5000 in your browser to view the UI.
```

Read the instructions [here](https://github.com/mlflow/mlflow/tree/master/docker-compose) for more details and configuration options for the docker compose bundle.

### Kubernetes[​](#kubernetes "Direct link to Kubernetes")

MLflow provides an official Helm chart for deploying on Kubernetes. See the [Kubernetes Helm Deployment guide](/docs/latest/self-hosting/kubernetes-helm.md) for step-by-step installation instructions, configuration options, and production examples.

Alternatively, a third-party chart is also available via [Community Helm Charts](https://artifacthub.io/packages/helm/community-charts/mlflow).

### Cloud Services[​](#cloud-services "Direct link to Cloud Services")

If you are looking for production-scale deployments without maintenance costs, MLflow is also available as managed services from popular cloud providers.

* [Databricks](https://www.databricks.com/product/managed-mlflow)
* [AWS Sagemaker](https://aws.amazon.com/sagemaker/ai/experiments/)
* [Azure Machine Learning](https://learn.microsoft.com/en-us/azure/machine-learning/concept-mlflow?view=azureml-api-2)
* [Nebius](https://nebius.com/services/managed-mlflow)
* [GCP (GKE)](https://gke-ai-labs.dev/docs/tutorials/frameworks-and-pipelines/mlflow/)

## Architecture[​](#architecture "Direct link to Architecture")

MLflow, at a high level, consists of the following components:

1. **Tracking Server**: The lightweight FastAPI server that serves the MLflow UI and API.
2. **Backend Store**: The Backend Store is relational database (or file system) that stores the metadata of the experiments, runs, traces, etc.
3. **Artifact Store**: The Artifact Store is responsible for storing the large artifacts such as model weights, images, etc.

Each component is designed to be pluggable, so you can customize it to meet your needs. For example, you can start with a single host mode with SQLite backend and local file system for storing artifacts. To scale up, you can switch backend store to PostgreSQL cluster and point artifact store to cloud storage such as S3, GCS, or Azure Blob Storage.

To learn more about the architecture and available backend options, see [Architecture](/docs/latest/self-hosting/architecture/overview.md).

## Workspaces[​](#workspaces "Direct link to Workspaces")

MLflow supports [workspaces](/docs/latest/self-hosting/workspaces.md) to organize experiments, registered models, prompts, and artifacts on a shared MLflow instance. Workspaces add logical separation and workspace-level permissions so teams can collaborate without running separate servers. Workspaces are opt-in and require a SQL database backend.

## Access Control & Security[​](#access-control--security "Direct link to Access Control & Security")

MLflow support [username/password login](/docs/latest/self-hosting/security/basic-http-auth.md) via basic HTTP authentication, [SSO (Single Sign-On)](/docs/latest/self-hosting/security/sso.md), and [custom authentication plugins](/docs/latest/self-hosting/security/custom.md).

MLflow also provides built-in [network protection](/docs/latest/self-hosting/security/network.md) middleware to protect your tracking server from network exposure.

Try Managed MLflow

Need highly secure MLflow server? Check out [Databricks Managed MLflow](https://www.databricks.com/product/managed-mlflow) to get fully managed MLflow servers with unified governance and security.

## FAQs[​](#faqs "Direct link to FAQs")

See [Troubleshooting & FAQs](/docs/latest/self-hosting/troubleshooting.md) for more information.

ACCESS DENIED?

When using the remote tracking server, you may hit an access denied error when accessing the MLflow UI from a browser.

> Invalid Host header - possible DNS rebinding attack detected

This error typically indicates that the tracking server's network security settings need to be configured. The most common causes are:

* **Host validation**: The `--allowed-hosts` flag restricts which Host headers are accepted
* **CORS restrictions**: The `--cors-allowed-origins` flag controls which origins can make API requests

To resolve this, configure your tracking server with the appropriate flags. For example:

bash

```
mlflow server --allowed-hosts "mlflow.company.com,localhost:*" \

              --cors-allowed-origins "https://app.company.com"
```

**Note**: These security options are only available with the default FastAPI-based server (uvicorn). They are not supported when using Flask directly or with `--gunicorn-opts` or `--waitress-opts`.

Refer to the [Network Security Guide](/docs/latest/self-hosting/security/network.md) for detailed configuration options.
