Railway

Deploy OmniRoute - Latest

Always up-to-date OmniRoute deployment with the latest release.

Deploy OmniRoute - Latest

Just deployed

/data

Just deployed

/data

Deploy and Host OmniRoute AI Gateway on Railway

OmniRoute AI Gateway is a unified AI proxy that routes multiple LLM providers through a single OpenAI-compatible endpoint. Instead of juggling separate provider URLs, request formats, and per-tool client configs, OmniRoute gives you one gateway for connecting models across providers. This template self-hosts it on Railway with a Redis-backed cache layer.

Deploy on Railway

OmniRoute

About Hosting OmniRoute AI Gateway

Hosting OmniRoute AI Gateway on Railway means running two services on Railway's private network: the omniroute app itself, and Redis for session and routing-state caching. The app connects to Redis over REDIS_URL on the private network, so no extra networking setup is needed beyond deploying both services from the template.

A persistent volume on the omniroute service keeps your dashboard configuration, providers, endpoints, and routing setup intact across redeploys. Redis has its own separate volume for its data (--save 60 1 — snapshotting every 60 seconds if at least one key changed).

Once it's up, open the public URL, add your provider credentials from the dashboard, create an endpoint and API key, then point tools like Claude Code, Cursor, Cline, OpenWebUI, or any OpenAI-compatible SDK at the generated /v1 endpoint.

Common Use Cases

  • Consolidate multiple LLM providers behind one endpoint instead of managing separate configs for OpenAI, Claude, Gemini, and OpenRouter-style APIs
  • Centralize provider key management — add and rotate credentials from a single dashboard rather than per-tool
  • Standardize coding-agent config — give Claude Code, Cursor, Cline, and other OpenAI-compatible tools one Base URL and API key
  • Route across models from a central gateway instead of hardcoding a provider per project
  • Run a self-hosted AI proxy for a team, an automation pipeline, or internal tooling — without depending on a third-party gateway

Dependencies for OmniRoute AI Gateway Hosting

ComponentDetails
OmniRoute imagediegosouzapw/omniroute:latest
Redisredis:8.2.1 — session and routing-state cache, password-protected
Railway private networkingomniroute reaches Redis via ${{Redis.REDIS_URL}}
Two persistent volumesone per service — see Volumes below
Public URLrequired on omniroute for dashboard and API access; Redis stays private
Provider API keysfrom whichever AI providers you plan to connect (added after deploy, from the dashboard)

Upstream references: OmniRoute GitHub · Docker image

Topology

ServiceRoleVolumePortPublic
omnirouteDashboard, routing, and API gateway/data20128Yes
redisSession / routing-state cache/data6379 (internal)No

Once deployed, omniroute exposes:

Dashboard:
https://your-domain

OpenAI-compatible API endpoint:
https://your-domain/v1

Volumes — what to mount

Attach both volumes before the first successful start. Skip this and configuration or cached state lands on ephemeral disk — the next redeploy wipes it.

ServiceMount pathWhat lives there
omniroute/dataDashboard configuration, connected providers, endpoints, routing setup
redis/dataRedis RDB snapshots (session/routing-state cache)

Note: the omniroute service also sets a DATA_DIR environment variable defaulting to /app/data — that's the path the application writes to internally inside the container. The Railway volume backing persistent storage is mounted at /data. Don't confuse the two when checking that persistence is actually wired up.

In Railway: open each service → SettingsVolumesAdd Volume → set the mount path exactly as shown above.

Configuration

Set automatically by the template — no action needed:

VariableDefaultDescription
PORT20128App listen port
HOSTNAME0.0.0.0Bind address
NODE_ENVproductionRuntime mode
BASE_URL / NEXT_PUBLIC_BASE_URLhttps://${{RAILWAY_PUBLIC_DOMAIN}}Public URL the app reports for itself
DATA_DIR/app/dataInternal app data path (see Volumes note above)
REDIS_URL${{Redis.REDIS_URL}}Private-network connection string to the Redis service
JWT_SECRET, API_KEY_SECRET, MACHINE_ID_SALTauto-generated 32-char secretsDo not set manually — regenerating these invalidates existing sessions and issued API keys
MODELS_DEVfalseEnables dev-only model listing when true
PRICING_SYNC_ENABLEDtrueKeeps provider pricing data synced
CLOUD_URLhttps://9router.comUpstream cloud service endpoint
NEXT_PUBLIC_CLOUD_URLhttps://omniroute.online/Public-facing cloud URL shown in the dashboard — intentionally a different host from CLOUD_URL above

Optional:

VariableDefaultDescription
INITIAL_PASSWORD(empty)Set this to pre-seed the first dashboard login password; leave blank to set it on first visit instead

Traps

Two things worth getting right before you deploy:

  • Attach the omniroute volume at /data, not /app/data. DATA_DIR=/app/data is an internal application setting, but the Railway volume itself mounts at /data. Mounting a volume at /app/data to "match" the env var doesn't connect it to what the template actually provisions — follow the Volumes table above, not the env var name.
  • Don't hand-set the auto-generated secrets (JWT_SECRET, API_KEY_SECRET, MACHINE_ID_SALT). They're generated once at deploy time. Overwriting them later invalidates every active session and every API key issued through the dashboard.

Why Deploy OmniRoute AI Gateway on Railway?

Railway is a single platform for your whole infrastructure stack — it hosts everything so you don't have to manage configuration, while still letting you scale vertically and horizontally as needed.

Deploying OmniRoute AI Gateway on Railway gets you a self-hosted AI routing layer with minimal operational overhead. Host your servers, databases, AI agents, and more, all in one place.


Template Content

More templates in this category

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

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
5
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
64