Deploy LobeHub Server + Postgres

LobeHub 2 server mode: AI chat and agents with Postgres, Redis and S3

Deploy LobeHub Server + Postgres

Just deployed

Just deployed

Just deployed

Just deployed

Deploy and Host LobeHub on Railway

LobeHub (formerly Lobe Chat) is an open-source AI agent workspace. It gives you a polished chat UI for OpenAI, Anthropic, Google, DeepSeek, Ollama and dozens more providers, plus agents, knowledge bases with RAG, file uploads, image generation, plugins and team accounts, all self-hosted.

About Hosting LobeHub

LobeHub 2.x only runs in server database mode, so a real deployment is four services: the app, Postgres with the pgvector and pg_search extensions, Redis, and an S3-compatible object store. This template mirrors the official Docker Compose stack: lobehub/lobehub:2.2.17, paradedb/paradedb:0.25.9-pg17 (Postgres 17 with both extensions preinstalled), redis:7-alpine and rustfs/rustfs:1.0.0-rc.6. Every secret is generated by Railway, every connection is a variable reference, the RustFS bucket is created automatically on first boot, and the app runs its own migrations. Email/password sign-in works out of the box with no third-party identity provider.

Common Use Cases

  • Team ChatGPT alternative: one self-hosted UI for every model provider, with per-user API keys or shared keys
  • Agents and knowledge bases: upload documents, chunk and embed them in pgvector, chat with your data
  • Private AI workspace: keep prompts, files and conversations on infrastructure you control
  • Multi-provider experimentation: switch models and compare answers without new tooling
  • Desktop and mobile companion: pair the LobeHub desktop app or CLI with your own server via OIDC

Dependencies for LobeHub Hosting

  • PostgreSQL 17 with pgvector and pg_search: required by the migrations (included as ParadeDB)
  • Redis: session store and caches (included)
  • S3-compatible storage: uploads, avatars, knowledge base files (included as RustFS with a public HTTPS endpoint for direct browser uploads)
  • LLM provider keys: optional at boot; add as variables or per user in Settings

Deployment Dependencies

Implementation Details

The app image already binds 0.0.0.0:3210; the template pins PORT=3210, HOSTNAME=0.0.0.0 and health checks GET /api/version. S3_ENDPOINT is the RustFS public domain because LobeHub signs upload URLs against it and the browser uploads directly. Files are read through short-lived presigned URLs, so the bucket stays private.

APP_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}
S3_ENDPOINT=https://${{RustFS.RAILWAY_PUBLIC_DOMAIN}}
S3_BUCKET=${{RustFS.RUSTFS_BUCKET}}
KEY_VAULTS_SECRET=${{secret(32)}}
AUTH_SECRET=${{secret(32)}}

First steps after deploy: open /signup on the LobeHub domain and create your account, then set AUTH_ALLOWED_EMAILS to your email or domain so registration is closed to strangers. Add provider keys as variables or in Settings. For desktop, CLI or mobile sign-in, paste a stable JWKS_KEY (generate it from the LobeHub docs); otherwise the template generates a fresh key on every deploy and those clients need to sign in again after a redeploy.

Why Deploy LobeHub 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 LobeHub on Railway, you get the complete official stack (app, ParadeDB Postgres, Redis, RustFS) with generated secrets, health checks, persistent volumes, managed SSL and private networking in one click.


Template Content

More templates in this category

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

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
5
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
71