Deploy Mage AI
Mage AI 0.9.80 data pipelines: Postgres, persistent volume, login on
Just deployed
/home/src
Just deployed
/var/lib/postgresql/data
Deploy and Host Mage AI on Railway
Mage AI is an open-source data pipeline tool and a modern alternative to Airflow. You build pipelines from Python, SQL and R blocks in a notebook-style editor, see each block's output as you go, and schedule, trigger and monitor the runs from the same web UI. It handles batch, streaming and data integration pipelines.
About Hosting Mage AI
Hosting Mage AI means running its web server and scheduler, which come in one container, next to a database for its metadata: users, pipeline runs, schedules and triggers. The pipeline code and each block's output are files, so they need persistent storage that survives redeploys. Mage turns on login by default but falls back to the owner login admin / admin, so a public instance needs its own owner password and its own session-signing secret. This template runs Mage AI 0.9.80 from the official image, keeps the metadata in Railway Postgres and the project on a volume, generates the owner password and secrets, and serves the UI over HTTPS on a Railway domain.
Common Use Cases
- Build and schedule ETL and ELT pipelines that load data from APIs, databases and files into a warehouse
- Sync data between SaaS tools and databases with Mage's data integration sources and destinations
- Run dbt models, Python transformations and data quality checks on a schedule or through an API trigger
Dependencies for Mage AI Hosting
- Mage AI 0.9.80, built from the official
mageai/mageaiimage - PostgreSQL for Mage's metadata (Railway Postgres, included)
Deployment Dependencies
- Mage AI on GitHub: https://github.com/mage-ai/mage-ai
- Mage AI 0.9.80 release: https://github.com/mage-ai/mage-ai/releases/tag/0.9.80
- Mage AI documentation: https://docs.mage.ai
- Template source: https://github.com/aalfath/mage-ai-railway-template
Implementation Details
The template has two services. Mage AI builds from the template repo. It keeps the project in /home/src/default_repo and block output and logs in /home/src/mage_data, on a volume mounted at /home/src. Postgres stores the metadata.
The only value you enter is DEFAULT_OWNER_EMAIL. After the deploy, log in with that email and the generated DEFAULT_OWNER_PASSWORD from the Mage AI service's Variables tab, then change the password in Mage. The container refuses to start if the password is empty or admin.
To install extra Python packages, list them in default_repo/requirements.txt (from Mage's file browser) and redeploy: they are installed at each start. Single sign-on, LDAP and SMTP notifications are optional and described in the Mage docs.
The Dockerfile flattens the official image into one layer. Without that, files the upstream image deletes in later layers (numpy 2) reappeared on Railway and Mage failed to start. Template updates come from the repo's main branch. Back up the volume and the database before applying a new Mage version, because Mage migrates its database on start.
Why Deploy Mage AI 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 Mage AI 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.
Template Content
DEFAULT_OWNER_EMAIL
Email of the Mage owner account, created on the first boot. You log in with it.

