Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

6.1 KB
Raw Blame
---
title: Build Your Own LobeHub - Choose Your Deployment Platform
description: >-
  Explore multiple deployment platforms like Vercel, Docker, Docker Compose, and
  more to deploy LobeHub. Choose the platform that best suits your needs.
tags:
  - LobeHub
  - Deployment Platform
  - Vercel
  - Docker
  - Docker Compose
  - Alibaba Cloud
---

# Build Your Own LobeHub

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'} />

## Architecture Overview

LobeHub consists of several key components:

### Core Services

- **Next.js application** β€” Hybrid SSR/SPA frontend with API routes
- **PostgreSQL database** β€” Stores conversations, agents, files, and user data
- **Redis** (optional) β€” Session storage and caching
- **S3-compatible storage** β€” File uploads and knowledge base documents

### Optional Services

- **RustFS / MinIO** β€” Self-hosted S3-compatible storage
- **Langfuse** β€” LLM observability and tracing
- **OpenTelemetry** β€” Distributed tracing
- **Searxng** β€” Privacy-focused web search

## Choosing a Deployment Method

### Docker Compose (Recommended)

**Best for:** Self-hosted installations, full infrastructure control, team deployments.

**Pros:**

- Complete stack in one command
- Easy updates with `docker compose pull`
- Includes PostgreSQL, Redis, RustFS, Searxng
- Full feature support β€” no timeout limits, WebSocket support

**Cons:**

- Requires server management
- Need to handle backups and monitoring

### Vercel

**Best for:** Quick deployments, serverless scaling, low maintenance.

**Pros:**

- One-click deployment
- Automatic HTTPS and CDN
- Scales automatically
- Free tier available

**Cons:**

- Requires an external PostgreSQL database
- 10-second serverless function timeout limit
- No WebSocket support
- Less control over infrastructure

### Cloud Platforms (Zeabur, Sealos, Dokploy)

Similar to Vercel with regional options. Good for specific geographic requirements with various pricing and feature differences.

## Feature Comparison

| 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          |

## Prerequisites

Before deploying LobeHub, gather the following:

### Required

**AI provider API keys** β€” At minimum, you need an API key from one AI provider:

- **OpenAI** β€” `OPENAI_API_KEY` from [platform.openai.com](https://platform.openai.com/account/api-keys)
- **Anthropic** β€” `ANTHROPIC_API_KEY` from [console.anthropic.com](https://console.anthropic.com/)
- **Google** β€” `GOOGLE_API_KEY` from [aistudio.google.com](https://aistudio.google.com/app/apikey)

See [AI Provider Configuration](/docs/self-hosting/environment-variables/model-provider) for the full list of supported providers.

**Database (for server deployment)** β€” PostgreSQL 14+ is required:

- **Managed options**: Neon, Supabase, Railway, Vercel Postgres
- **Self-hosted**: Docker (included in Docker Compose), AWS RDS, Google Cloud SQL

### Optional but Recommended

**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:

- **AWS S3** β€” Production-ready, scalable
- **Cloudflare R2** β€” No egress fees
- **RustFS / MinIO** β€” Self-hosted S3 alternative (included in Docker Compose)

**Multimodal understanding fallback** β€” Optional, but recommended if users will upload audio, images, or videos while chatting with models that lack the corresponding native multimodal capabilities. Configure `MULTIMODAL_UNDERSTANDING_PROVIDER` and `MULTIMODAL_UNDERSTANDING_MODEL` with a multimodal model from one of your enabled AI providers. See [Basic environment variables](/docs/self-hosting/environment-variables/basic#multimodal-understanding) for details.

**Authentication provider** β€” For SSO and team features (Google OAuth, GitHub OAuth, Microsoft Azure AD, Auth0, Keycloak). See [Authentication Setup](/docs/self-hosting/auth) for configuration.

## Security Considerations

<Callout type={'warning'}>
  Never commit API keys or secrets to version control. Always use environment variables.
</Callout>

Essential security measures:

1. **Use HTTPS** β€” Always deploy with SSL/TLS certificates
2. **Secure your database** β€” Use strong passwords and restrict network access
3. **Environment variables** β€” Store secrets securely (never in code)
4. **Authentication** β€” Enable Better Auth for multi-user deployments
5. **Regular updates** β€” Keep LobeHub and dependencies up to date

Authentication options:

- **Open access** β€” No authentication (single-user deployments only)
- **Better Auth** β€” Built-in auth with email/password, OAuth, magic links
- **Reverse proxy** β€” Use Authelia, Authentik, or similar

## Next Steps

1. **Choose your deployment method** β€” Docker for maximum control or Vercel for simplicity
2. **Gather API keys** β€” Obtain API keys from your chosen AI providers
3. **Set up infrastructure** β€” Provision database, Redis, and storage as needed
4. **Configure environment variables** β€” See the [environment variable reference](/docs/self-hosting/environment-variables)
5. **Deploy** β€” Follow the platform-specific guide above
6. **Configure authentication** β€” Set up [Better Auth](/docs/self-hosting/auth) for multi-user access