---
title: "Deploy Big-AGI"
description: "Open-source AI workspace for many models, behind a login, with Postgres"
category: "AI/ML"
url: https://railway.com/deploy/big-agi
---

# Deploy Big-AGI

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

**[Deploy Big-AGI on Railway](https://railway.com/template/big-agi)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/big-agi/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Big-AGI https://raw.githubusercontent.com/enricoros/big-AGI/v2.1.3/public/icons/icon-512x512.png

- **Source:** https://github.com/aalfath/big-agi-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# 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

* [Big-AGI repository](https://github.com/enricoros/big-AGI) and [v2.1.3 release](https://github.com/enricoros/big-AGI/releases/tag/v2.1.3)
* [Environment variables](https://github.com/enricoros/big-AGI/blob/v2.1.3/docs/environment-variables.md)
* [Template source and changelog](https://github.com/aalfath/big-agi-railway-template)

### 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.



## 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/big-agi
