Deploy magpie

One AI gateway for Claude Code, Codex and Gemini CLI on any model

Deploy magpie

Just deployed

/config

Deploy and Host self hosted magpie (AI Coding Agent Gateway) on Railway

Deploy magpie as a single Railway service that runs the upstream gateway with a persistent config volume and a public HTTPS domain.

About Hosting magpie open-source software on Railway (self hosted magpie template)

This template runs one magpie service built on the upstream 0.1.2679 image, serving the browser UI and the gateway's /v1 routes on one HTTPS domain.

Railway runs the container, public domain, TLS, and persistent volume for you.

Why Deploy magpie, the open-source AI coding agent gateway on Railway (Railway Free Trial)

Self-hosting magpie on Railway keeps your provider keys and gateway keys in a service you control.

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.

Railway vs Other Hosting Providers and VPS for magpie self hosting

Choosing where the gateway runs changes how much you manage yourself.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA deployed magpie service with a public HTTPS domain, a persistent /config volume and generated keys.A droplet you configure yourself, including Docker, the volume, TLS and firewall rules.
AWSOne managed service with the domain and volume set up from the template.Broad networking and scaling control, with a steeper setup for one gateway.
HetznerManaged hosting with the domain, volume and key handling already wired.Low-cost raw servers you run yourself, suited to people comfortable with Linux and Docker.

Pick Railway for a quick start, or a VPS when you want to own every layer.

Common Use Cases for hosted magpie

  • One gateway URL for every coding agent: Point Claude Code, Codex, Gemini CLI and other agents on your laptop or in CI at the same hosted address, so you configure provider access once instead of in every tool.
  • Running Claude Code or Codex on other models: Route an agent that normally talks to one vendor onto a different model or provider through the gateway, without changing how you use the agent itself.
  • Failing over when a provider quota runs out: Add more than one account or provider and let magpie move requests along to the next option, so a long coding session does not stop at the first rate limit.
  • Sharing provider keys across a small team: Keep one set of provider credentials on the server and hand each teammate or client their own gateway key, so access can be revoked per person without rotating the upstream keys.
  • Reaching providers from remote machines: Use the deployed gateway from a remote workstation or a build runner that cannot hold your provider secrets directly, sending all agent traffic through the one HTTPS domain.

Dependencies for magpie Docker hosted on Railway

This template runs one service built from the onepush-dev image, which sits on the upstream ghcr.io/yetone/magpie 0.1.2679 image.

Deployment Dependencies for Managed magpie Service (one magpie service with a /config volume)

The template has one service named magpie with a public domain on port 3430, which serves the browser UI and the gateway's /v1 routes.

VariableDefaultWhat it does
MAGPIE_WEB_KEYgenerated 32-character secretLogin key for the web UI, passed once as ?k=
MAGPIE_PUBLIC_URLhttps://${{RAILWAY_PUBLIC_DOMAIN}}Public address magpie uses in its links

You can also add MAGPIE_ALLOW_IPS to restrict connecting addresses, DO_NOT_TRACK=1 to turn off telemetry, and DISABLE_AUTOUPDATER=1 to stop self-updates.

Implementation Details for magpie (Using the onepush-dev image built on the upstream 0.1.2679 image)

The image is pinned to the 0.1.2679 release by digest, not the moving latest tag. The internal gateway on 3425 is not exposed publicly.

How does magpie compare against other tools

magpie vs LiteLLM (LiteLLM Alternative)

  • Client reach: LiteLLM is a self-hosted LLM proxy for application traffic. magpie targets coding agents and rewrites the model setting in their own config files.
  • Subscriptions: magpie can sign in to Claude, ChatGPT, Copilot, Gemini or Grok plans you already pay for. Check provider terms before relying on this for a team.
  • Where LiteLLM wins: for a broad, mature proxy with many provider integrations and team budgeting, LiteLLM is the more established choice.

magpie vs OpenRouter (OpenRouter Alternative)

  • Hosting: OpenRouter is a hosted model router with one account and one bill. magpie runs on your own machine or Railway service and holds your provider keys there.
  • Mixing providers: magpie combines your API keys, local models and subscriptions, so you are not limited to OpenRouter's catalog.
  • Where OpenRouter wins: for zero infrastructure and one invoice across many models, OpenRouter is simpler.

magpie vs claude-code-router (claude-code-router Alternative)

  • Scope: claude-code-router is a local router for Claude Code. magpie covers Claude Code, Codex and Gemini CLI through one gateway.
  • Remote use: the Railway template exposes the gateway over HTTPS, so agents on other machines or in CI can use it.
  • Where claude-code-router wins: for one laptop and a single agent, it is lighter to set up.

magpie desktop app vs magpie on Railway (magpie Desktop vs Hosted Comparison)

  • Who it is for: the desktop app manages agents on your computer. The Railway service is a gateway with a web page for reaching the same providers from other machines.
  • Agents: the Railway container has no agents inside it, so the page runs in gateway mode without the Agents tab.
  • Keys and data: on the desktop, keys stay on your computer. On Railway they sit in the /config volume, as private as your project access.
  • Where the desktop app wins: for switching models on your own machine day to day, it is the more complete experience.

How to use magpie on Railway?

  1. Wait for the magpie service to show green in the Railway dashboard.
  2. Open your public domain with ?k= followed by your MAGPIE_WEB_KEY once, for example https://your-domain/?k=your-web-key. The browser keeps a cookie for 400 days.
  3. Add a provider under Providers, using an API key or a subscription sign-in. For a subscription, paste the localhost callback URL into the Callback URL field.
  4. Create one gateway key per client under Gateway, so you can revoke one without touching the others.
  5. Point agents at the domain plus /v1 for OpenAI style clients, or the bare domain for Anthropic and Gemini style clients.

To confirm the gateway answers:

curl https://your-domain/v1/models \
  -H "Authorization: Bearer your-gateway-key"

A JSON list of models means the gateway and key work. An empty list usually means no provider is added yet.

How to self host magpie on other VPS Services (magpie self hosting guide)

You can run magpie on a VPS you manage yourself. These steps follow the upstream flow.

Clone the Repository

Get the source to read the upstream docs and keep your files together.

git clone https://github.com/yetone/magpie.git
cd magpie

Install Dependencies

Docker is the simplest route on a server. On a desktop, the install script works instead.

curl -fsSL https://usemagpie.ai/install.sh | sh

Configure Environment Variables

Set a web key of 16 characters or more, and the public URL your agents will reach.

export MAGPIE_WEB_KEY=your-long-random-key
export MAGPIE_PUBLIC_URL=https://your-domain

Start the magpie Application

Run the upstream image as documented at usemagpie.ai/docs/docker, with a volume for config.

docker run -d --name magpie -p 3430:3430 -v magpie-config:/config \
  -e MAGPIE_WEB_KEY="$MAGPIE_WEB_KEY" \
  -e MAGPIE_PUBLIC_URL="$MAGPIE_PUBLIC_URL" \
  ghcr.io/yetone/magpie

On a VPS you must put HTTPS in front of port 3430 yourself, which Railway handles for you.

Official Pricing of magpie (magpie pricing)

magpie is MIT open-source software and free to self-host. Mail providers are optional and cost whatever they cost.

magpie hosted vs self hosted comparison (Pricing, features, costs, and more)

magpie is a free app with no hosted gateway plan. The feature set is the same on Railway, a VPS, or your own machine.

Monthly cost of self hosting magpie on Railway

Railway bills by usage, so the monthly figure depends on the RAM and CPU magpie uses, the size of the /config volume, and what else runs in the project.

System Requirements for Hosting magpie on a VPS

A VPS needs enough memory and disk for the container, plus a persistent directory for config so providers and gateway keys survive restarts.

Frequently Asked Questions (FAQs)

Where do I find the login key for magpie?

The login key is the value of MAGPIE_WEB_KEY, which Railway generates for you as a secret.

Why is there no Agents tab in my magpie dashboard?

The Railway deployment runs magpie in gateway mode, so the page hides the Agents and Sessions tabs.

Which port does the public domain use?

The domain routes to port 3430, which serves both the browser UI and the gateway's /v1 routes.

Can several people share one magpie deployment?

Yes.

How do I update magpie to a newer version?

Change the image tag in the service settings to a newer upstream release and let Railway redeploy.

Is magpie related to Apache Magpie?

No. magpie is an open-source AI coding agent gateway by its upstream authors, and this template is not affiliated with Apache Magpie or its project.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1