docs/self-hosting/start.mdx
LobeHub can be self-hosted on your own infrastructure, giving you complete control over your data, customization, and deployment environment. Whether you're deploying for a team, organization, or personal use, LobeHub supports multiple deployment methods.
<PlatformCards urlPrefix={'platform'} />
LobeHub consists of several key components:
Best for: Self-hosted installations, full infrastructure control, team deployments.
Pros:
docker compose pullCons:
Best for: Quick deployments, serverless scaling, low maintenance.
Pros:
Cons:
Similar to Vercel with regional options. Good for specific geographic requirements with various pricing and feature differences.
| Feature | Docker | Vercel | Cloud Platforms |
|---|---|---|---|
| Full control | ✅ | ❌ | ⚠️ |
| Custom domain | ✅ | ✅ | ✅ |
| One-click deploy | ❌ | ✅ | ✅ |
| Auto-scaling | ❌ | ✅ | ✅ |
| Free tier | ✅ | ✅ | Varies |
| Function timeout | Unlimited | 10s | Varies |
| WebSocket support | ✅ | ❌ | Varies |
| File storage | Local/RustFS | External S3 | Varies |
| Database | Included | External | Varies |
Before deploying LobeHub, gather the following:
AI provider API keys — At minimum, you need an API key from one AI provider:
OPENAI_API_KEY from platform.openai.comANTHROPIC_API_KEY from console.anthropic.comGOOGLE_API_KEY from aistudio.google.comSee AI Provider Configuration for the full list of supported providers.
Database (for server deployment) — PostgreSQL 14+ is required:
Redis — Improves performance for session storage, rate limiting, and caching. Use Upstash, Redis Cloud, or self-hosted Redis.
S3-compatible storage — Required for file uploads and knowledge bases:
Authentication provider — For SSO and team features (Google OAuth, GitHub OAuth, Microsoft Azure AD, Auth0, Keycloak). See Authentication Setup for configuration.
<Callout type={'warning'}> Never commit API keys or secrets to version control. Always use environment variables. </Callout>
Essential security measures:
Authentication options: