
Deploy 9Router V3
A self-hosted AI gateway: one endpoint, many providers, automatic fallback.
Just deployed
/data
Deploy and Host 9Router V3 on Railway
9Router V3 is a self-hosted AI gateway that exposes one OpenAI-compatible endpoint for many AI providers. It includes automatic provider fallback, key rotation, a web dashboard, usage tracking, proxy management, authentication, CLI integrations, and optional browser automation in a single deployable service.
9Router vs V2 vs V3
| Capability | Original 9Router | 9Router V2 | 9Router V3 |
|---|---|---|---|
| OpenAI-compatible API | ✅ | ✅ | ✅ |
| Multi-provider routing and fallback | ✅ | ✅ | ✅ |
| Separate backend and frontend | ❌ | ✅ | ✅ |
| Express backend with a Vite/React dashboard | ❌ | ✅ | ✅ |
| Multi-stage production Docker image | ❌ | ❌ | ✅ |
| API and dashboard in one service | ❌ | ❌ | ✅ |
| Local development workflow | ✅ | ✅ | ✅ |
| Docker deployment | ❌ | ❌ | ✅ |
| VPS deployment guide | ❌ | ✅ | ✅ |
Heroku Procfile support | ❌ | ❌ | ✅ |
| Configurable persistent data directory | ❌ | ✅ | ✅ |
| Railway deployment configuration | ❌ | ❌ | ✅ |
| Self-hosted Material Symbols | ❌ | ❌ | ✅ |
| API-key dialog with loading and error feedback | ❌ | ❌ | ✅ |
| V3 branding, logo, and login experience | ❌ | ❌ | ✅ |
| PayPal donation QR on the login page | ❌ | ❌ | ✅ |
| Generated browser profiles excluded from Git | ❌ | ❌ | ✅ |
9Router V3 builds on the routing engine and provider integrations created by the upstream projects. Its main additions are production packaging, deployment portability, persistent runtime configuration, dashboard reliability, and the V3 user experience.
About Hosting 9Router V3
Hosting 9Router V3 on Railway runs the Express API and compiled React dashboard together in one container. Railway builds the included multi-stage Dockerfile, injects the service port, monitors /api/health, and restarts failed deployments. The application generates its JWT and API-key signing secrets automatically and stores them in the data directory. For the standard template flow, the only value a user needs to provide is INITIAL_PASSWORD; all other essential runtime configuration is supplied by Railway, the Docker image, or generated securely on first boot. Persistent installations should mount a Railway Volume at /data.
Common Use Cases
- Provide one OpenAI-compatible endpoint for multiple AI providers and models.
- Manage provider credentials, routing, fallback, quotas, and API keys from a web dashboard.
- Connect tools such as Codex, Claude Code, Cline, OpenCode, and other OpenAI-compatible clients.
- Run a private AI gateway for a team, homelab, or internal application.
Dependencies for 9Router V3 Hosting
- A Railway account and project.
- The 9Router V3 GitHub repository or Railway template.
- A Railway Volume mounted at
/datafor persistent SQLite data. - Provider credentials for whichever AI services you choose to use.
Deployment Dependencies
- Deploy 9Router V3 on Railway
- Railway Volumes documentation
- Railway Public Networking documentation
- 9Router V3 environment example
Implementation Details
For the normal Railway template flow:
- Click Deploy on Railway.
- Set
INITIAL_PASSWORDto a strong dashboard password. - Deploy the template.
The container already sets:
NODE_ENV=production
DATA_DIR=/data
Railway provides PORT and domain metadata automatically. When JWT_SECRET or API_KEY_SECRET is not supplied, 9Router V3 creates a cryptographically random value and persists it under DATA_DIR.
If you deploy directly from the repository instead of the prepared template, attach a Railway Volume to /data before relying on the service for persistent data.
Why Deploy 9Router V3 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 V3 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.
Template Content
INITIAL_PASSWORD
