Deploy Antirion
Deploy Antirion on Railway. Official AI gateway image. Always latest.
Caddy Port (for API)
Just deployed
Antirion
Just deployed
Deploy and Host Antirion on Railway
Antirion is an open-source AI gateway: one Rust binary, with the admin console built in, between your apps and every model provider. Point official SDKs at a single URL, then route, budget, guard, and log calls to OpenAI, Anthropic, Gemini, Bedrock, and many others. A standalone node keeps state in an embedded store—no PostgreSQL or Valkey required.
About Hosting Antirion
This template runs the official image (eliasbiondo/antirion:latest) with one volume at /var/lib/antirion. A new deploy or rebuild pulls the newest release rather than a pinned third-party image. It gives each plane its own HTTPS domain:
- Console domain (Antirion, port 8081): the admin console and Admin API. The console lives at
/ui/, so openhttps://<console-domain>/ui/. The root path returns anot_foundJSON, which is expected. - API domain (a small Caddy service, port 3000, proxying Antirion's private port 8080): the
/v1data plane your apps and SDKs call.
The image is distroless and runs as UID 65532. The bootstrap token is set as a Railway variable so you can copy it from the Variables tab.
Common Use Cases
- Point apps at one OpenAI-, Anthropic-, Gemini-, or Bedrock-compatible URL and route to many providers
- Issue virtual keys per app or team, with rate limits and dollar or token budgets
- Keep traffic up with fallback chains, least-latency or least-cost routing, retries, and circuit breakers
- Watch spend and the request log per key, team, and model, with alerts before a budget runs out
- Screen prompts and responses for PII, secrets, and other guardrails, with format-preserving redaction
Dependencies for Antirion Hosting
- Official Docker image
eliasbiondo/antirion:latest(amd64 and arm64) - One persistent volume mounted at
/var/lib/antirion(embedded store, spool, generated encryption key) - A Caddy service that exposes the data plane on its own domain
- No PostgreSQL or Valkey in standalone mode (this template)
- Your own provider API keys, added in the console after deploy (stored encrypted on the volume)
- Optional: SMTP (
ANTIRION_SMTP_*) for invites, password resets, and email alerts
Deployment Dependencies
Implementation Details
Environment variables (Antirion service):
| Variable | Value | Notes |
|---|---|---|
ANTIRION_BOOTSTRAP_TOKEN | ${{secret(48, "abcdef0123456789")}} | Paste this into the console's Admin token field. It is also the Admin API bearer token. |
ANTIRION_PUBLIC_ORIGIN | https://${{RAILWAY_PUBLIC_DOMAIN}} | The console domain. Cookie-authenticated console writes must come from this origin. |
ANTIRION_DATA_PLANE_URL | (set after deploy) | Optional. The API domain, used only in the console's code examples. |
ANTIRION_ENCRYPTION_KEY is optional (base64 of 32 random bytes, openssl rand -base64 32). If unset, the gateway generates one into the volume. Back up the volume either way: stored provider keys cannot be read without that key. Optional SMTP: ANTIRION_SMTP_HOST, ANTIRION_SMTP_PORT, ANTIRION_SMTP_TLS, ANTIRION_SMTP_USERNAME, ANTIRION_SMTP_PASSWORD, ANTIRION_SMTP_FROM.
Health check: GET /-/readyz on port 8081, no credential needed.
First run:
- Wait until both services are healthy.
- Open the console at
https://<console-domain>/ui/(don't forget/ui/) and pasteANTIRION_BOOTSTRAP_TOKENfrom the Variables tab into Admin token. - Optional: copy the API domain from the Caddy service and set it as
ANTIRION_DATA_PLANE_URLon the Antirion service so the console shows the right URL in its examples. - Add a provider with your LLM API key, then a model that points at it.
- Create a virtual key for the app or team (it is shown once).
- Point your SDK at the API domain:
curl -s https://<api-domain>/v1/chat/completions \
-H "Authorization: Bearer sk-antirion-…" -H 'Content-Type: application/json' \
-d '{"model": "chat", "messages": [{"role": "user", "content": "Hello"}]}'
/v1/responses, /v1/messages, /v1/embeddings, and Gemini and Bedrock paths are supported too.
Why Deploy Antirion 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 Antirion 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.
This template uses the official latest tag and a single /var/lib/antirion volume for a standalone node.
Template Author
Created and maintained by Douglas Rubim.
GitHub: https://github.com/douglasrubims
Template Content
Caddy Port (for API)
douglasrubims/railway-second-portAntirion
eliasbiondo/antirion:latest
