Deploy Big-AGI

Open-source AI workspace for many models, behind a login, with Postgres

Deploy Big-AGI

/var/lib/postgresql/data

Deploy and Host Big-AGI on Railway

Big-AGI is an open-source AI workspace (MIT) for people who use several models at once. It connects to OpenAI, Anthropic, Gemini, OpenRouter, Ollama and a dozen other providers, and adds Beam (ask several models, merge the best answer), personas, voice, image generation, diagrams and file attachments.

About Hosting Big-AGI

Big-AGI is a Next.js app with no login of its own, so this template never exposes it directly. The official image (v2.1.3, pinned by digest) runs with a small Caddy gateway in the same service: every page and API route asks for a username and a generated password, and only the health check answers without it. Railway's Postgres stores shared chat links; the table is created on boot. Chats, settings and the API keys you type in stay in each user's browser. After deploy, open the URL, sign in as admin with BASIC_AUTH_PASSWORD from the service's Variables, and add a model provider key.

Common Use Cases

  • One private chat UI for many model providers, with side-by-side comparison
  • Beam: send one prompt to several models and merge the answers
  • A password-protected front end for an Ollama or LocalAI server on your private network

Dependencies for Big-AGI Hosting

  • Postgres (included, with a volume) for Chat Link Sharing
  • An API key from at least one model provider, added in the app or as a variable

Deployment Dependencies

Implementation Details

The template deploys two services:

  • Big-AGI: built from aalfath/big-agi-railway-template. Caddy listens on PORT (8080) with basic auth and proxies to Big-AGI on 127.0.0.1:3000. The health check path is /healthz. Only the bcrypt hash of the password reaches Caddy.
  • Postgres: Railway's Postgres 18 with a volume. POSTGRES_PRISMA_URL and POSTGRES_URL_NON_POOLING point at it over the private network.

To share server-side model keys with everyone who has the login, add variables such as OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY or OLLAMA_API_HOST to the Big-AGI service. Without them, each user adds their own keys in the app. To rotate the login, change BASIC_AUTH_PASSWORD and redeploy.

Updates: the service builds from the template repo. When we bump the pinned version, Railway shows an update notice in your project and you choose when to apply it. Read the repo's CHANGELOG.md first. Chats live in browsers, so use Big-AGI's export if you want a backup.

Why Deploy Big-AGI 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 Big-AGI 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

More templates in this category

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

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1