Deploy DB-GPT Data Agent + Auth Gateway

DB-GPT data agent: chat with SQL and docs, private behind a login gateway

Deploy DB-GPT Data Agent + Auth Gateway

DB-GPT Gateway

caddy:2.11-alpine

Just deployed

Deploy and Host DB-GPT on Railway

DB-GPT is an open source AI native data app framework. Ask questions about your databases in plain language and get SQL, charts and answers back, analyze Excel and CSV files, build knowledge bases for RAG, generate dashboards, and run multi agent data analysis and AWEL workflows. This template runs it against any OpenAI compatible API, with no GPU needed.

About Hosting DB-GPT

DB-GPT has no built in login: every visitor is treated as an admin, and the app can run SQL against connected databases and execute agent generated code. This template therefore never exposes it directly. The DB-GPT service runs on Railway's private network only, and a small Caddy gateway is the single public entry point, protected by a generated username and password and a cross site request guard. DB-GPT uses the official no GPU image eosphorosai/dbgpt-openai:v0.8.2, stores its metadata in SQLite and its vectors in embedded Chroma, both on one persistent volume, and keeps its database migrations on that same volume so redeploys and upgrades are safe.

Common Use Cases

  • Chat with your database: connect MySQL, PostgreSQL, ClickHouse, DuckDB or SQLite and ask questions in natural language (Text2SQL)
  • Spreadsheet analysis: upload Excel or CSV files and explore them conversationally
  • Knowledge base Q&A: index documents and URLs for retrieval augmented answers
  • Generative dashboards and data agents: let agents plan an analysis, write the SQL and render the charts

Dependencies for DB-GPT Hosting

  • An OpenAI compatible API key: required, used for both chat and embeddings. OpenAI is the default; OpenRouter, DeepSeek, a LiteLLM proxy and other compatible endpoints work by changing the base URL and model names
  • Your own databases: optional, added from the UI. An example Walmart sales database is preloaded

Deployment Dependencies

Implementation Details

ServiceImagePublicVolume
DB-GPT Gatewaycaddy:2.11-alpineyesnone
DB-GPTeosphorosai/dbgpt-openai:v0.8.2no/app/pilot/data

First Steps After Deploy

  1. Open the DB-GPT Gateway public URL
  2. Log in with UI_USERNAME (default admin) and UI_PASSWORD, both on the gateway's Variables tab
  3. Try Chat Data against the preloaded Walmart_Sales database
  4. Add your own data sources and knowledge bases

Key Environment Variables

VariableServicePurpose
OPENAI_API_KEYDB-GPTRequired LLM and embeddings key
OPENAI_API_BASEDB-GPTOpenAI compatible chat endpoint
LLM_MODEL_NAMEDB-GPTChat model, default gpt-4o
EMBEDDING_MODEL_NAME / EMBEDDING_MODEL_API_URLDB-GPTEmbedding model and full endpoint URL
DBGPT_ENCRYPT_KEYDB-GPTGenerated; encrypts stored secrets, never rotate
UI_USERNAME / UI_PASSWORDDB-GPT GatewayLogin for the whole app

Notes

  • Single tenant: anyone with the gateway password has full admin access
  • The Hobby plan or higher is recommended; the Free plan's 0.5 GB of RAM is likely too small
  • Custom domain: attach it to the gateway and add it to DBGPT_CORS_ALLOWED_ORIGINS on the DB-GPT service

Why Deploy DB-GPT 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 DB-GPT 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

DB-GPT Gateway

caddy:2.11-alpine

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

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

bento
1