---
title: "Deploy magpie"
description: "Deploy magpie with web UI on Railway."
category: "AI/ML"
url: https://railway.com/deploy/magpie-1
---

# Deploy magpie

Deploy magpie with web UI on Railway.

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

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

- **Creator:** Ruter's Projects
- **Category:** AI/ML

## Template content

### magpie https://usemagpie.ai/img/magpie-small.svg

- **Image:** ghcr.io/yetone/magpie:latest
- **Start command:** `/magpie web --lan --no-open`
- **Public domain:** Yes

## Documentation

# Deploy and Host magpie on Railway

magpie is a self-hosted AI gateway and management platform that provides a unified interface for interacting with multiple AI model providers. It supports OpenAI-compatible APIs, provider management, model routing, and a built-in Web UI for configuring and managing AI services. magpie helps developers run their own AI infrastructure while keeping control of their API keys and data.

## About Hosting magpie

Hosting magpie on Railway provides a simple way to run your own AI gateway without managing servers or container infrastructure. This template deploys the official magpie Docker image, starts the Web UI/API service, and exposes it through Railway's public networking.

The deployment requires configuring persistent storage for magpie's configuration files and setting an authentication key to protect your publicly accessible instance. Railway volumes ensure that provider settings, profiles, and other application data persist across deployments and restarts.

## Common Use Cases

- Run a private OpenAI-compatible API gateway for multiple AI model providers
- Manage and route requests between different AI providers from a single Web UI
- Provide a self-hosted AI backend for applications, agents, and developer tools

## Dependencies for magpie Hosting

- A Railway Volume mounted at `/config` for persistent configuration storage
- A `MAGPIE_WEB_KEY` environment variable to secure Web UI access

### Implementation Details

This template uses the official magpie Docker image:

```bash
ghcr.io/yetone/magpie:latest
```

The service starts magpie Web UI with:

```bash
/magpie web --lan --no-open
```

Required environment variable:

```bash
MAGPIE_WEB_KEY=
RAILWAY_RUN_UID=0
```

The configuration directory should be persisted using a Railway Volume:

```
Mount Path:
/config
```

The `/config` directory stores magpie configuration files such as provider settings and profiles.

## Why Deploy magpie 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 magpie 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/magpie-1
