Learn how to deploy MLflow on AWS with our step-by-step guide. It walks you through launching the Meetrix MLflow AMI with CloudFormation, pointing your domain at the server, signing in, logging your first run from code, adding your team, and keeping the server backed up and healthy once it runs.

MLflow is an open-source platform for the machine learning lifecycle. Data scientists and ML engineers use it to log parameters, metrics and artifacts from every training run, compare runs side by side, and version models in a shared model registry. AI teams use the same server to trace, evaluate and version prompts for GenAI and agent applications, such as apps built on a model you serve yourself with vLLM on AWS.

The Meetrix image runs MLflow 3.18.0 on Ubuntu 26.04 with login required for the UI and API, a PostgreSQL backend store, an artifact store proxied through the server, and Nginx with Let's Encrypt SSL. Your team's runs, models and users stay in your own AWS account. If you would rather run PostgreSQL on a server of its own for other applications, see our PostgreSQL developer guide.

Prerequisites

Before you get started with the MLflow AMI, ensure you have the following prerequisites:

  • Basic knowledge of AWS services, including EC2 instances and CloudFormation.
  • An active AWS account with permission to create EC2, VPC, IAM and CloudFormation resources.
  • An EC2 key pair in the region you will deploy to.
  • A domain name for MLflow, such as mlflow.example.com. If it is a Route 53 hosted zone in the same AWS account, the SSL certificate is issued automatically during launch.
  • If you encounter a vCPU quota error when launching the stack, follow https://meetrix.io/blogs/increase-aws-vcpu-quota/ to increase your vCPU limit.

Launching the AMI

Step 1: Find and Select MLflow AMI

  1. Log in to your AWS Management Console.
  2. Navigate to 'MLflow MLOps Platform - Experiment Tracking and Model Registry' in AWS Marketplace.

Step 2: Initial Setup & Configuration

  1. Click the "Continue to Subscribe" button.
  2. After subscribing, accept the terms and click "Accept Terms".
  3. Wait a few minutes until processing completes, then click "Continue to Configuration".
  4. Select the CloudFormation fulfillment option and choose your region. Click "Continue to Launch".
  5. From the "Choose Action" dropdown, select "Launch CloudFormation" and click "Launch".

Create CloudFormation Stack

Step 1: Create a stack

  1. Ensure the "Template is ready" option is selected under "Prepare template".
  2. Click "Next".

Step 2: Specify stack options

  1. Provide a unique "Stack name".
  2. Enter the "AdminEmail" used for SSL certificate generation. Let's Encrypt sends its expiry notices here.
  3. Enter an "AdminPassword" for the MLflow admin user. It must be 12 to 64 characters long and can use letters, digits and the characters ! @ # % ^ * _ + = . , - only.
  4. Leave "AmiId" as filled in by AWS Marketplace.
  5. Enter a value for "DeploymentName", or keep prod. It goes into the names of the stack's resources, including the IAM role, so use a different one for each stack in the same account.
  6. Provide a lowercase public domain for "DomainName", such as mlflow.example.com. MLflow only answers on this domain and the server's Elastic IP.
  7. Choose an instance type "InstanceType" (Default: t3a.medium). Choose t3a.large or larger for many concurrent users or large model artifacts.
  8. Select your preferred "KeyName".
  9. Enter an "S3Bucket" for database backups, or keep yours3bucket if you don't want backups to S3. The bucket must already exist.
  10. Set "SSHLocation" to your own IP range, such as 203.0.113.10/32, or 0.0.0.0/0 to allow SSH from anywhere.
  11. Keep "SubnetCidrBlock" as 10.0.0.0/24.
  12. Keep "VpcCidrBlock" as 10.0.0.0/16.
  13. Click "Next".

Step 3: Configure stack options

  1. Choose "Roll back all stack resources" and "Delete all newly created resources" under "Stack failure options".
  2. Click "Next".

Step 4: Review

  1. Review and verify the parameters you've entered.
  2. Tick "I acknowledge that AWS CloudFormation might create IAM resources with custom names".
  3. Click "Submit".
CloudFormation capabilities notice for AWS::IAM::Policy and AWS::IAM::Role with the IAM resources acknowledgement checkbox ticked

The stack creates an IAM role for the instance. It can only change Route 53 records to issue the SSL certificate, upload database backups to your S3 bucket, and tell CloudFormation when setup has finished.

CloudFormation Parameters tab for the MLflow stack showing AdminEmail, AdminPassword, AmiId, DeploymentName, DomainName, InstanceType set to t3a.medium, KeyName, S3Bucket, SSHLocation and the CIDR blocks

Afterward, you'll be directed to the CloudFormation stacks page. Wait until the stack status shows CREATE_COMPLETE, usually about 3 minutes. The stack only completes once the server has finished its first boot: it generates a new database password and server secret key for this server only, writes your domain into the configuration, starts MLflow, creates the admin user from your AdminPassword and then deletes the password from disk, checks that the login works and tries to issue the SSL certificate. MLflow is ready as soon as the stack is.

If the first boot fails, or doesn't finish within 20 minutes, the stack fails and rolls back. See Troubleshoot below.

Besides the instance and its 30 GB gp3 root volume, the stack creates a VPC with a public subnet, internet gateway and route table, an Elastic IP, and a security group that opens ports 80 and 443 to everyone and port 22 to your SSHLocation only.

Update DNS

Step 1: Copy IP Address

Copy the public IP labeled "PublicIp" in the "Outputs" tab. The tab also shows DashboardUrl, the HTTPS address on your domain, and DashboardUrlIp, the HTTP address on the Elastic IP.

MLflow CloudFormation stack Outputs tab listing DashboardUrl, DashboardUrlIp and PublicIp

Step 2: Create an A record

  1. Go to AWS Route 53 and navigate to "Hosted Zones", then open your domain's zone.
  2. Click Create record.
  3. Add a record name matching the DomainName you entered, keep the record type as A, and paste the copied PublicIp into the value textbox.
  4. Click "Create records".
Route 53 Quick create record form for an A record in the hosted zone, with Record name, Value, TTL and the Create records button

If your domain is hosted with another DNS provider, create the same A record there, then generate the SSL certificate manually as shown below.

Access MLflow

Open the "DashboardUrl" from the Outputs tab, https://<your domain>, in your browser. Until the A record resolves or the certificate is issued, use the "DashboardUrlIp" instead, which serves MLflow over plain HTTP.

MLflow asks for a login in the browser's own sign-in prompt. Enter the username admin and the AdminPassword you set in the stack parameters. Store them securely for future reference.

Browser Sign in prompt for the MLflow domain with Username and Password fields

After you sign in, the MLflow home page opens. The version (3.18.0) is shown under the logo, the switch at the top of the sidebar moves between the GenAI and Model training views, and the signed-in user is shown at the bottom.

MLflow 3.18.0 Welcome page signed in as admin, with the GenAI and Model training switch, Experiments, AI Registry, AI Gateway and the Recent Experiments list

Note

The sign-in prompt sends your password with every request, so use the HTTPS domain once the certificate is issued and keep the HTTP IP address for first checks only.

Generate SSL Manually

MLflow tries to issue the Let's Encrypt certificate during launch, through a Route 53 DNS challenge. This works only when your domain is a Route 53 hosted zone in the same AWS account. If it doesn't work, the stack still completes and MLflow is served over HTTP. Follow these steps to generate the certificate manually.

Step 1: Point your domain at the server

  1. Follow the Update DNS steps above, if not already done.
  2. Check that your domain returns the PublicIp from the Outputs tab:
nslookup <your domain>

Step 2: Log in to the server

  1. Open the terminal and go to the directory where your private key is located.
  2. Run the following command, replacing the key name and IP address.
  3. Type "yes" and press Enter to confirm.
ssh -i <your key name> ubuntu@<Public IP address>
Terminal connecting to the server over SSH and confirming the host fingerprint

Step 3: Generate SSL

Run the following command and follow the prompts:

sudo bash /root/certificate_generate_standalone.sh

Log Runs From Your Code

Point any MLflow client at the server with three environment variables. The username and password are the same ones you sign in to the UI with:

export MLFLOW_TRACKING_URI=https://<your domain>
export MLFLOW_TRACKING_USERNAME=admin
export MLFLOW_TRACKING_PASSWORD=<AdminPassword>

Then log a run from Python:

import mlflow

mlflow.set_experiment("my-experiment")
with mlflow.start_run():
    mlflow.log_param("alpha", 0.5)
    mlflow.log_metric("rmse", 0.12)
    mlflow.log_artifact("model.pkl")

The run appears under Experiments in the UI. Artifacts are uploaded through the server, so your laptop or training job needs no AWS credentials and no access to the server's disk. Nginx sets no upload size limit, so large model files go through. The MLflow documentation covers autologging for libraries such as scikit-learn, PyTorch and XGBoost, the model registry, and GenAI tracing.

Give each person their own account rather than sharing the admin password, as shown in the next section.

Add Users and Permissions

Signed in as admin, open Settings and then Users to create users. You can also create them through the REST API:

curl -u admin:<AdminPassword> -X POST https://<your domain>/api/2.0/mlflow/users/create \
  -H "Content-Type: application/json" \
  -d '{"username": "alice", "password": "<a strong password>"}'

A new user can read every other user's experiments and registered models, and can edit what they create themselves. To give new users no access to other people's work instead, change default_permission from READ to NO_PERMISSIONS in /opt/mlflow/basic_auth.ini and restart MLflow:

sudo nano /opt/mlflow/basic_auth.ini

sudo systemctl restart mlflow

Change a password

The AdminPassword stack parameter is only used on the first boot, so changing it on the stack later does not change the login. To change a user's password, including admin's, call the API as admin:

curl -u admin:<current admin password> -X PATCH https://<your domain>/api/2.0/mlflow/users/update-password \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "<new password>"}'

Store Artifacts in S3

By default, artifacts are stored in /var/lib/mlflow/artifacts on the server's disk. To store new artifacts in an S3 bucket instead, first give the instance role access to the bucket. The role is named mlflow-<DeploymentName>, for example mlflow-prod. Save this policy as artifacts-policy.json, replacing the bucket name:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
      "Resource": "arn:aws:s3:::<bucket>/*"
    },
    {
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::<bucket>"
    }
  ]
}

Attach it to the role from a machine with IAM access:

aws iam put-role-policy --role-name mlflow-prod --policy-name mlflow-artifacts --policy-document file://artifacts-policy.json

Then, on the server, change --artifacts-destination in /etc/systemd/system/mlflow.service from /var/lib/mlflow/artifacts to s3://<bucket>/mlflow-artifacts, and reload the service:

sudo nano /etc/systemd/system/mlflow.service

sudo systemctl daemon-reload && sudo systemctl restart mlflow

Clients still upload through the server, so they still need no AWS credentials. Runs created before the change keep their artifacts on the local disk. For tips on moving large files into S3 yourself, see our guide to copying large files to S3.

Back Up the Database

The database holds your experiments, runs, model registry and users. If you set an S3Bucket at launch, this script dumps it and uploads the dump to s3://<S3Bucket>/mlflow-dbbackup/:

sudo /opt/scripts/dbbackup.sh

To run it every day at 02:00, schedule it with cron:

echo "0 2 * * * root /opt/scripts/dbbackup.sh" | sudo tee /etc/cron.d/mlflow-dbbackup

Artifacts are not in the database backup

The script backs up the database only. Back up /var/lib/mlflow/artifacts separately, for example with EBS snapshots or aws s3 sync, or move artifacts to S3 as shown above. Our guide to backing up business data on AWS automatically shows how to schedule EBS snapshots.

The instance role can upload backups but cannot list or download them. To restore, copy a dump from a machine with read access to the bucket onto the server, then load it:

sudo systemctl stop mlflow
zcat dump_YYYY-MM-DD-HH-MM-SS.sql.gz | sudo -u postgres psql -d mlflow
sudo systemctl start mlflow

Server Configuration

These are the files you are most likely to change on the server:

Path What it holds
/etc/systemd/system/mlflow.serviceThe MLflow server command line, including the artifact destination
/opt/mlflow/mlflow.envDatabase URI, server secret key, allowed hosts and CORS origins
/opt/mlflow/basic_auth.iniAuthentication settings, including the default permission
/opt/mlflow/venvThe Python environment MLflow runs in
/var/lib/mlflow/artifactsThe local artifact store

Serve MLflow on another domain

MLflow rejects requests for a hostname it doesn't know. To serve it on another domain as well, add the name to MLFLOW_SERVER_ALLOWED_HOSTS and https://<name> to MLFLOW_SERVER_CORS_ALLOWED_ORIGINS in /opt/mlflow/mlflow.env, then restart MLflow:

sudo nano /opt/mlflow/mlflow.env

sudo systemctl restart mlflow

Turn off telemetry

MLflow sends anonymous usage data by default, and the home page shows a notice about it. To turn it off, add this line to /opt/mlflow/mlflow.env and restart MLflow:

MLFLOW_DISABLE_TELEMETRY=true

Check Server Logs

Step 1: Log in to the server

ssh -i <your key name> ubuntu@<Public IP address>
Terminal connecting to the server over SSH with a private key

Step 2: Check the logs

MLflow runs as the mlflow systemd service, behind nginx, with its data in postgresql. Check that they are running, then follow the MLflow logs:

sudo systemctl status mlflow nginx postgresql

sudo journalctl -u mlflow -f

Press Ctrl+C to stop following the logs. To restart MLflow:

sudo systemctl restart mlflow

Shutting Down MLflow

  1. In CloudFormation, open the "Resources" tab and click the physical ID of the Instance resource to open the EC2 instance.
  2. Stop the MLflow instance from the Instance state dropdown. You can restart it later as needed.
CloudFormation Resources tab with the EC2 Instance physical ID link EC2 Instance state dropdown with the Stop instance option

The Elastic IP stays attached and your runs and artifacts stay on the disk while the instance is stopped. Training jobs that log to MLflow fail while it is down.

Remove MLflow

Back up first

Deleting the stack deletes the instance and its disk, with the database and every local artifact on it. Take a database backup and copy the artifacts you want to keep before you delete the stack.

Delete the CloudFormation stack from the AWS Management Console under "CloudFormation Stacks" by clicking "Delete". Remove the Route 53 record you created as well. Backups in your S3 bucket are not deleted.

If you added the mlflow-artifacts policy to the instance role for S3 artifacts, delete it first. CloudFormation only manages the policy it created, and a role that still has other policies attached can fail to delete:

aws iam delete-role-policy --role-name mlflow-prod --policy-name mlflow-artifacts

Upgrades

When a new version is available in AWS Marketplace, launch a new stack with it and move across:

  1. Launch the new stack with a different DeploymentName, such as prod2. The old stack's IAM role, mlflow-prod, still exists, and IAM role names must be unique in the account.
  2. Take a database backup on the old server and restore it on the new one, as shown in Back Up the Database. MLflow upgrades the schema when it starts. The restore brings your users and their passwords across, so sign in to the new server with your old admin password afterwards.
  3. Copy /var/lib/mlflow/artifacts to the same path on the new server. If your artifacts are in S3, give the new instance role the same S3 policy and set the same --artifacts-destination instead.
  4. Point your A record at the new PublicIp. If the certificate was not issued automatically, generate it manually as shown above.

Once you've checked the new server, remove the old stack.

To upgrade MLflow in place on an existing server instead, back up the database first, then install the new version into MLflow's Python environment and restart it. MLflow upgrades the database schema when it starts. Check the MLflow releases for breaking changes before you do.

sudo /opt/mlflow/venv/bin/pip install "mlflow[auth,db]==<new version>"
sudo systemctl restart mlflow

Troubleshoot

If you face vCPU quota limits, request an increase: How to increase AWS quota.

CloudFormation event showing CREATE_FAILED with a VcpuLimitExceeded error

If you face insufficient capacity errors while creating the stack, try another region or time.

CloudFormation event showing CREATE_FAILED with an InsufficientInstanceCapacity error

If the stack rolls back because the instance sent a failure signal or did not signal within 20 minutes, the first boot did not finish. To see why, create the stack again with "Preserve successfully provisioned resources" under "Stack failure options", log in to the server and read the first-boot output:

sudo tail -n 100 /var/log/cloud-init-output.log

If the page shows 502 Bad Gateway, Nginx is running but MLflow is not answering. Check the service and its logs as shown in Check Server Logs, then restart it.

Nginx 502 Bad Gateway error page

If the sign-in prompt keeps coming back, the username or password is wrong. The admin user is admin, in lowercase, and its password is the AdminPassword from the stack parameters. If your code gets a 401 error, check MLFLOW_TRACKING_USERNAME and MLFLOW_TRACKING_PASSWORD. A 403 error means the user is signed in but has no permission on that experiment or model.

If MLflow rejects requests when you open it under a name other than your DomainName or the Elastic IP, that name is not in its allowed hosts. Add the name as shown in Serve MLflow on another domain.

Check whether the instance storage is full. Log into the server and run:

df -h
df -h output showing usage of the root filesystem

If the root volume is between 90-100%, move artifacts to S3 or resize the EBS volume, then reboot and restart MLflow.

Conclusion

The Meetrix MLflow Deployment Guide helps you run a shared, password-protected MLflow tracking server and model registry in your AWS environment, with your experiments, models and users in your own account. Whether you're a data scientist comparing training runs, an ML engineer managing model versions or an AI team evaluating LLM applications, this guide provides step-by-step instructions for a secure setup. See the MLflow store page for what the Meetrix image includes, and the MLflow GitHub repository for the project itself.

Technical Support

Reach out to Meetrix Support (aws@meetrix.io) for assistance with MLflow issues.

Frequently Asked Questions

What is MLflow?

MLflow is an open-source platform for the machine learning lifecycle. It tracks experiments (parameters, metrics and artifacts from each training run), versions models in a central model registry, and records traces and evaluations for GenAI and agent applications. The Meetrix AMI runs an MLflow 3.18.0 tracking server and model registry that your whole team logs to.

How do I log runs from my code to this server?

Set three environment variables before you run your training code: MLFLOW_TRACKING_URI to https://<your domain>, MLFLOW_TRACKING_USERNAME to your MLflow username, and MLFLOW_TRACKING_PASSWORD to its password. Any MLflow client (Python, R, Java or the REST API) then logs runs, metrics and artifacts to the server. Clients don't need AWS credentials, because artifacts are uploaded through the server.

How do I add users, and what can they see?

Sign in as admin and add users from Settings, Users, or call POST /api/2.0/mlflow/users/create. New users can read every other user's experiments and models by default and can edit only their own, unless you grant them more. The default is set by default_permission in /opt/mlflow/basic_auth.ini.

Where are artifacts stored, and can I use S3 instead?

Artifacts (models, plots, datasets) are stored on the server's disk in /var/lib/mlflow/artifacts, and experiments, runs, the model registry and users are stored in a local PostgreSQL database. boto3 is pre-installed, so you can move new artifacts to an S3 bucket by giving the instance role access to the bucket and changing --artifacts-destination in the MLflow service. Runs created before the change keep their local artifacts.

Which instance type do I need?

The default t3a.medium (2 vCPU, 4 GB) runs MLflow and PostgreSQL comfortably for a small team. Large artifacts are uploaded through the server, so for many concurrent users or heavy artifact traffic, choose t3a.large or larger. The root volume is 30 GB of gp3; resize it, or move artifacts to S3, as they grow.

How do I back up MLflow?

Run /opt/scripts/dbbackup.sh, or schedule it with cron, to dump the mlflow database (runs, registry and users) and upload it to the S3Bucket you set at launch. The script does not include artifacts, so back up /var/lib/mlflow/artifacts separately, for example with EBS snapshots or aws s3 sync.

How do I get technical support?

Reach out to Meetrix Support at aws@meetrix.io for assistance with MLflow issues.

Ready to Deploy Your Own MLflow Server?

Get started in minutes with our pre-configured AMI and give your team a shared, self-hosted MLflow tracking server and model registry.

Deploy MLflow from AWS Marketplace