---
title: "Deploy MLflow"
description: "MLflow 3.16 tracking server with login, Postgres and artifact storage."
category: "AI/ML"
url: https://railway.com/deploy/mlflow-1
---

# Deploy MLflow

MLflow 3.16 tracking server with login, Postgres and artifact storage.

**[Deploy MLflow on Railway](https://railway.com/template/mlflow-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mlflow-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### mlflow https://github.com/mlflow.png

- **Image:** ghcr.io/mlflow/mlflow:v3.16.1-full
- **Start command:** `sh -c 'mkdir -p /mlartifacts && printf "[mlflow]\ndefault_permission = READ\ndatabase_uri = sqlite:////mlartifacts/basic_auth.db\nadmin_username = %s\nadmin_password = %s\nauthorization_function = mlflow.server.auth:authenticate_request_basic_auth\n" "$MLFLOW_ADMIN_USERNAME" "$MLFLOW_ADMIN_PASSWORD" > /tmp/basic_auth.ini && MLFLOW_AUTH_CONFIG_PATH=/tmp/basic_auth.ini exec mlflow server --host 0.0.0.0 --port 5000 --backend-store-uri "$MLFLOW_BACKEND_STORE_URI" --artifacts-destination /mlartifacts --serve-artifacts --app-name basic-auth --allowed-hosts "$MLFLOW_ALLOWED_HOSTS"'`
- **Health check:** /health
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host MLflow on Railway

MLflow is the open-source platform for the machine learning and generative AI lifecycle. It tracks experiments, parameters, metrics and artifacts, manages models in a registry, traces LLM applications and evaluates their output. Python, R, Java and TypeScript clients log to a shared tracking server that the whole team can browse.

## About Hosting MLflow

This template deploys the MLflow v3.16.1 tracking server from the official full image with a Railway Postgres database for runs and the model registry. Artifacts such as models and plots are stored on a Railway volume and served through the tracking server, so clients need no cloud storage credentials. The built-in basic-auth app is on: the admin account uses a generated password, and new users get read access by default. The server checks the Host header against your Railway domain. Artifacts can grow quickly, so watch the volume on the Hobby plan. Back up Postgres regularly.

## Common Use Cases

- Tracking experiments and comparing training runs across a team
- A model registry for versioning and promoting models
- Tracing and evaluating LLM and agent applications

## Dependencies for MLflow Hosting

- `ghcr.io/mlflow/mlflow:v3.16.1-full` (official image)
- Railway Postgres (`ghcr.io/railwayapp-templates/postgres-ssl:18`) with a volume
- A Railway volume at `/mlartifacts` for artifacts and the auth database

### Deployment Dependencies

- [MLflow documentation](https://mlflow.org/docs/latest/)
- [MLflow v3.16.1 release](https://github.com/mlflow/mlflow/releases/tag/v3.16.1)
- [MLflow authentication](https://mlflow.org/docs/latest/self-hosting/security/basic-http-auth/)
- [Railway volumes](https://docs.railway.com/reference/volumes)

### Implementation Details

| Service | Image | Networking | Storage |
| --- | --- | --- | --- |
| mlflow | `ghcr.io/mlflow/mlflow:v3.16.1-full` | public domain on 5000; private | volume at `/mlartifacts` |
| Postgres | Railway Postgres 18 | private only | volume |

```python
import os, mlflow
os.environ["MLFLOW_TRACKING_USERNAME"] = "admin"
os.environ["MLFLOW_TRACKING_PASSWORD"] = ""
mlflow.set_tracking_uri("https://")
with mlflow.start_run():
    mlflow.log_metric("accuracy", 0.93)
```

| Variable | Default | Purpose |
| --- | --- | --- |
| `MLFLOW_ADMIN_USERNAME` / `MLFLOW_ADMIN_PASSWORD` | `admin` / generated | Admin login |
| `MLFLOW_FLASK_SERVER_SECRET_KEY` | generated | Required by the auth app for CSRF |
| `MLFLOW_ALLOWED_HOSTS` | public, private and health-check hosts | Host header allow list |

Notes:

- Users and permissions live in `basic_auth.db` on the volume; the admin password is only applied when that database is first created.
- The server listens on `0.0.0.0`, so private clients connect over IPv4.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the MLflow project or its maintainers.

## Why Deploy MLflow on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying MLflow on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/mlflow-1
