Railway

Deploy 9Router AI Gateway [Aug'26]

Self-hosted AI gateway for Claude Code, Cursor & 40+ LLM providers

Deploy 9Router AI Gateway [Aug'26]

decolua/9router:0.5.55

decolua/9router:0.5.55

Just deployed

/app/data

Deploy and Host 9Router on Railway

9Router is an open-source, self-hosted AI gateway and LLM router. It puts a single OpenAI-compatible endpoint in front of 40+ AI providers and 100+ models, so Claude Code, Cursor, Cline, Codex, Copilot, and Gemini CLI all authenticate against your own gateway instead of scattering provider API keys across every tool you use.

About Hosting 9Router

Hosting 9Router means running one Node.js service with a persistent disk. There is no PostgreSQL, Redis, or external database to operate: providers, issued API keys, fallback chains, usage history, and settings all live in an embedded SQLite database under /app/data, alongside automatic backups. This template deploys the official decolua/9router image pinned to a known-good version, attaches the volume, serves the dashboard and the /v1 API on an HTTPS domain, and generates the session and API-key signing secrets fresh for your deployment. You pick a dashboard password before deploying; everything else is pre-configured.

Common Use Cases

  • Give a team one OpenAI-compatible gateway URL for every AI coding tool, so provider keys live in one place instead of on each developer's laptop
  • Ride out per-provider rate limits and quota exhaustion with automatic fallback chains, without editing any client configuration
  • Track AI spend across providers: which model answered which request, and what it cost
  • Run a private AI proxy for internal apps, autonomous agents, and any OpenAI-compatible SDK client

Dependencies for 9Router Hosting

  • A Railway volume mounted at /app/data for the SQLite database and its backups
  • Accounts or API keys with the upstream AI providers you want to route to; 9Router meters those calls but does not resell tokens
  • A dashboard password, supplied as INITIAL_PASSWORD at deploy time

Implementation Details

The image listens on port 20128, so PORT is pinned to 20128 rather than a more common default, and the HTTP proxy is bound to that same port. Deploys are gated on GET /api/health, which returns {"ok": true} without authentication.

Security-relevant settings are hardened rather than left at their upstream defaults:

  • REQUIRE_API_KEY is true, so /v1/* rejects unauthenticated calls. Issue a key from the dashboard before pointing a client at the gateway. Left at its default, a public gateway is an open proxy to your provider credits.
  • AUTH_COOKIE_SECURE is true, because Railway terminates TLS in front of the service.
  • JWT_SECRET, API_KEY_SECRET, and MACHINE_ID_SALT are generated per deployment instead of falling back to shared upstream defaults.
  • INITIAL_PASSWORD is required at deploy time. The upstream default is 123456, which is not something to ship on a public domain.

After deploying, open https://your-domain/dashboard, sign in, add your providers, build a fallback chain, and issue an API key. Then point any OpenAI-compatible tool at https://your-domain/v1. The dashboard's CLI Tools section shows the exact per-tool configuration for Claude Code, Cursor, Codex, Gemini CLI, and others.

Why Deploy 9Router 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 9Router on Railway, you are one step closer to supporting a complete AI development workflow with minimal operational burden. Host your gateway, APIs, databases, agents, and everything else your stack needs in one place.


Template Content

decolua/9router:0.5.55

decolua/9router:0.5.55

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
4
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
64