---
title: "Deploy Octopus LLM API Gateway"
description: "Self-hosted LLM API gateway: one endpoint for OpenAI, Claude, Gemini & more"
category: "AI/ML"
url: https://railway.com/deploy/octopus-llm-api-gateway
---

# Deploy Octopus LLM API Gateway

Self-hosted LLM API gateway: one endpoint for OpenAI, Claude, Gemini & more

**[Deploy Octopus LLM API Gateway on Railway](https://railway.com/template/octopus-llm-api-gateway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/octopus-llm-api-gateway/manifest.json

- **Creator:** My Projects
- **Category:** AI/ML

## Template content

### Octopus https://raw.githubusercontent.com/bestruirui/octopus/master/web/public/logo.svg

- **Image:** bestrui/octopus:latest
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host Octopus LLM API Gateway on Railway

[Octopus](https://github.com/bestruirui/octopus) is a lightweight, self-hosted LLM API aggregation gateway. Plug in multiple provider channels (OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter, any OpenAI-compatible endpoint) and expose a single, unified API with automatic failover, protocol conversion and cost analytics — all managed from a clean web dashboard.

## About Hosting Octopus

This template runs the official `bestrui/octopus` image as a single service with a persistent volume mounted at `/app/data` (SQLite database + auto-generated `config.json`). A public HTTPS domain is generated automatically and a healthcheck guards zero-downtime redeploys. No external database is required.

**After deploy:**
1. Open the generated domain.
2. Log in with the default credentials **`admin` / `admin`** and **change the password immediately** in Settings.
3. Add your provider channels (API keys), create groups, and generate API keys for your clients.
4. Point any OpenAI- or Anthropic-compatible client at `https://YOUR-RAILWAY-DOMAIN/v1`.

## Common Use Cases

- One endpoint for all your LLM providers, with automatic failover when an upstream fails
- Use Claude Code / Codex / Cursor / agents against any model via OpenAI ⇄ Anthropic ⇄ Responses API conversion
- Track token usage and cost per key, channel and model
- Share controlled API access with teammates without sharing raw provider keys

## Dependencies for Octopus Hosting

- Docker image `bestrui/octopus` (Go single binary with embedded web UI)
- Persistent volume for `/app/data`

### Deployment Dependencies

- Source: https://github.com/bestruirui/octopus
- Configuration reference (env vars `OCTOPUS_*`): https://github.com/bestruirui/octopus#-environment-variables

### Implementation Details

Optional environment variables you can add to the service:

| Variable | Purpose |
|---|---|
| `OCTOPUS_DATABASE_TYPE` | `sqlite` (default), `mysql` or `postgres` |
| `OCTOPUS_DATABASE_PATH` | Connection string, e.g. `${{Postgres.DATABASE_URL}}?sslmode=disable` |
| `OCTOPUS_LOG_LEVEL` | `info` (default), `debug`, `warn` |

## Why Deploy Octopus 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 Octopus 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.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/octopus-llm-api-gateway
