Deploy 9Router AI Gateway [Sep'26]
Self-hosted AI gateway for Claude Code, Cursor & 40+ LLM providers
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 — including OpenAI, Anthropic, Google Gemini, Mistral, Groq, DeepSeek, and OpenRouter — and 100+ models, so Claude Code, Cursor, Cline, Codex, Copilot, Windsurf, 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 for OpenAI, Anthropic, and Gemini 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/datafor the SQLite database and its backups - Accounts or API keys with the upstream AI providers you want to route to (OpenAI, Anthropic, Gemini, or any of the 40+ others 9Router supports); 9Router meters those calls but does not resell tokens
- A dashboard password, supplied as
INITIAL_PASSWORDat 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 — verified against a live deployment of this template.
Security-relevant settings are hardened rather than left at their upstream defaults:
REQUIRE_API_KEYistrue, so/v1/*rejects unauthenticated calls with a401. 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_SECUREistrue, because Railway terminates TLS in front of the service.JWT_SECRET,API_KEY_SECRET, andMACHINE_ID_SALTare generated per deployment instead of falling back to shared upstream defaults.INITIAL_PASSWORDis required at deploy time. The upstream default is123456, which is not something to ship on a public domain.
After deploying, open https://<your-domain>/dashboard and sign in with your INITIAL_PASSWORD — the login screen's "Default password is 123456" notice is static copy shown on every fresh install, not a sign that your password wasn't applied; it works as set. Add your providers, build a fallback chain, and issue an API key. Then point any OpenAI-compatible tool at https://<your-domain>/v1, or for Anthropic-style clients:
export ANTHROPIC_BASE_URL="https://<your-domain>"
export ANTHROPIC_AUTH_TOKEN="<key from the dashboard>"
The dashboard's CLI Tools section shows the exact per-tool configuration for Claude Code, Cursor, Codex, Gemini CLI, Windsurf, 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.55INITIAL_PASSWORD
Password for your first dashboard login. Choose a strong one — it protects every provider key you add.
