---
title: "Deploy LobeHub"
description: "LobeHub, formerly LobeChat: AI chat and agents with Postgres and storage"
category: "AI/ML"
url: https://railway.com/deploy/lobehub-1
---

# Deploy LobeHub

LobeHub, formerly LobeChat: AI chat and agents with Postgres and storage

**[Deploy LobeHub on Railway](https://railway.com/template/lobehub-1)**

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

- **Creator:** Dektion Studio
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

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

- **Image:** paradedb/paradedb:latest-pg17

### rustfs https://cdn.jsdelivr.net/gh/devicons/devicon@v2.16.0/icons/rust/rust-original.svg

- **Image:** rustfs/rustfs:latest
- **Start command:** `/bin/sh -c 'mkdir -p /data && exec rustfs /data'`
- **Health check:** /health
- **Public domain:** Yes

### lobehub https://raw.githubusercontent.com/lobehub/lobehub/769c006afcc6cbe0dbf03f5f6e82950f1469dd44/public/app-icons/icon-192x192.png

- **Source:** dektionstudio/railway-template-images
- **Health check:** /signin
- **Public domain:** Yes

## Documentation

# Deploy and Host LobeHub on Railway

[LobeHub](https://github.com/lobehub/lobehub) is an open-source AI chat and agent workspace: one interface for OpenAI, Anthropic, Google, OpenRouter, Ollama and many other providers, with agents, knowledge bases and file uploads. This template runs the server-database edition, where your chats, agents and settings live in your own Postgres and sync across devices.

## About Hosting LobeHub

The deploy form asks for one thing: your email address. Only that address, or the addresses and domains you list there separated by commas, can create an account, so a stranger who finds your URL can't sign up. When the deploy finishes, open `LOBEHUB_URL` from the Variables tab of the lobehub service, sign up with that email and add your provider keys in LobeHub's settings. Keys saved there are encrypted with `KEY_VAULTS_SECRET`.

The template has three services: LobeHub itself on the official image, Postgres on ParadeDB (Postgres 17 with pgvector and pg_search, the image LobeHub's own compose file uses) and RustFS for uploaded files.

I started with a Railway Bucket for the files. LobeHub uploads from the browser straight to storage through signed links, which needs a CORS rule on the bucket, and Railway Buckets don't keep one: the API accepts the rule and stores nothing. RustFS does keep it, so this template uses RustFS, as LobeHub's compose file does. The bucket stays private. LobeHub shows files through signed links that expire, and anonymous requests get a 403.

LobeHub signs its internal service calls, file parsing for example, with an RSA key in `JWKS_KEY`, and those calls fail without it. A Railway template can't generate an RSA key, so a small start script creates one on first boot, stores it in the private bucket and reads it back on every restart. If you set `JWKS_KEY` yourself, yours is used.

Before publishing I ran the template end to end. Signing up with a different email was refused with `EMAIL_NOT_ALLOWED` and signing up with the allowed one worked. An upload through a signed link passed the browser's CORS check and landed in the bucket, and LobeHub parsed the file into chunks, which is the path that needs `JWKS_KEY`. A chat through OpenRouter answered. After a restart the account and the file were still there and the same signing key was reused.

The logs warn that `QSTASH_TOKEN` isn't set. That's Upstash's hosted queue, which LobeHub uses to create scheduled jobs; without it those are skipped, and chat, uploads and file parsing all worked in my test.

## Common Use Cases

- One chat interface for all your model providers, with history synced across your devices
- Upload documents to a knowledge base and ask questions about them

## Dependencies for LobeHub Hosting

An API key for at least one model provider (OpenAI, Anthropic, Google, OpenRouter and others), added in LobeHub's settings after you sign up.

### Deployment Dependencies

- LobeHub: https://github.com/lobehub/lobehub
- Self-hosting docs: https://lobehub.com/docs/self-hosting/start
- Image: `lobehub/lobehub`
- The wrapper this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/lobehub

### Implementation Details

```
AUTH_ALLOWED_EMAILS=you@example.com          # who can sign up
APP_URL=https://
DATABASE_URL=${{Postgres.DATABASE_URL}}      # private network
KEY_VAULTS_SECRET, AUTH_SECRET               # generated per deploy
S3_ENDPOINT=https://          # browsers upload and load files here
S3_INTERNAL_ENDPOINT=http://:9000
S3_BUCKET=lobehub                            # created on first start, private
S3_ENABLE_PATH_STYLE=1
S3_SET_ACL=0
```

If you add a custom domain, set `APP_URL` to it and redeploy the lobehub service: the start script moves the bucket's CORS rule to the new address on every start.

The lobehub service builds from the newest LobeHub release, and LobeHub runs its database migrations on start. To stay on one version, set `LOBEHUB_VERSION` (an image tag) on the lobehub service.

Idle, the lobehub service used 0.44 GB of RAM, Postgres 0.32 GB and RustFS 0.07 GB.

## Why Deploy LobeHub on Railway?

Your chats, agents and uploaded files stay in a database and bucket you own, behind a sign-up only you can use. The three services come to about $8 a month in RAM at idle; model usage is billed by your providers.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/lobehub-1
