
Deploy MaxKB RAG Agents + Postgres
MaxKB RAG and agent platform with pgvector Postgres and Redis
Redis
Just deployed
Postgres
Just deployed
Just deployed
Deploy and Host MaxKB on Railway
MaxKB is an open source platform for building enterprise knowledge base assistants and AI agents. Upload documents or crawl websites into a knowledge base, and MaxKB splits, embeds and indexes them for retrieval augmented generation (RAG). Build chat assistants and multi step agent workflows with a visual editor, call tools and MCP servers, and connect any major LLM: OpenAI, Anthropic, DeepSeek, Qwen, Gemini, Ollama and more.
About Hosting MaxKB
The upstream image bundles PostgreSQL and Redis inside one container. This template runs them as separate Railway services instead, which the image supports natively: when MAXKB_DB_HOST and MAXKB_REDIS_HOST point elsewhere, the bundled servers stay off. You get three services: MaxKB (1panel/maxkb:v2.10.8-lts) on a public domain, PostgreSQL 17 with pgvector (vectors, data and uploaded files), and Redis (cache, login sessions, task queue). Each has its own volume.
The admin account is protected from the first boot. Upstream ships a public default password (MaxKB@123..); this template generates a random initial password in MAXKB_DEFAULT_PASSWORD instead, so a fresh deploy cannot be claimed by someone who finds the URL first. The start command waits for Postgres, enables the vector extension, and starts MaxKB without the upstream 180 second boot deadline that kills slow first boots.
Common Use Cases
- Internal knowledge assistant: answer questions from company docs, wikis and websites with citations
- Customer support bot: embed a chat widget on your site, backed by your product docs
- Agent workflows: visual flows with branching, tools, MCP servers and custom Python functions
- Model playground: compare providers and local models behind one UI
Dependencies for MaxKB Hosting
- PostgreSQL 17 + pgvector (included)
- Redis (included)
- An LLM provider key: optional at boot, added in the UI under Models
- Hobby plan or higher: MaxKB runs a web server, a local embedding model server and a task worker in one container; upstream recommends 8 GB RAM. Trial and Free memory limits are too small
Deployment Dependencies
Implementation Details
First steps after deploy:
- Wait for the MaxKB service to turn healthy (the first boot pulls a 1.2 GB image and runs database migrations; allow 5 to 10 minutes).
- Open the MaxKB domain. You land on
/admin. - Log in as
adminwith the value ofMAXKB_DEFAULT_PASSWORDfrom the MaxKB service variables, then change the password when prompted. - Add a model under Models (for example an OpenAI key), create a knowledge base, upload documents, and create an application.
Key variables on the MaxKB service:
PORT=8080
MAXKB_DEFAULT_PASSWORD=MaxKB1! # initial admin password, read once on first boot
MAXKB_SECRET_KEY= # signs login tokens
MAXKB_DB_HOST=${{Postgres.RAILWAY_PRIVATE_DOMAIN}}
MAXKB_REDIS_HOST=${{Redis.RAILWAY_PRIVATE_DOMAIN}}
MAXKB_CORE_WORKER=1 # raise to 2 or 3 on bigger plans
MAXKB_DEFAULT_PASSWORD only seeds the admin account on the very first boot. Changing it later does not change the password; use the UI for that. The bundled embedding model is tuned for Chinese text; for English knowledge bases add an embedding model from your provider. Back up the Postgres service with pg_dump (uploaded files live in Postgres large objects, which pg_dump includes by default).
Why Deploy MaxKB 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 MaxKB 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

