LobeHub supports a diverse range of deployment strategies tailored for different use cases, from individual local usage to enterprise-grade self-hosting. The architecture leverages Next.js for web delivery and Electron for desktop distribution, utilizing a unified core logic across all platforms.
The following diagram illustrates the relationship between the build artifacts and their target environments.
Build Artifact to Deployment Mapping
Sources: Dockerfile111-114 Dockerfile135-145
LobeHub is optimized for Vercel, utilizing the serverless output mode for scalable, zero-maintenance hosting. It also supports other cloud providers like Zeabur, Sealos, and Alibaba Cloud through standard web deployment patterns. Key configurations include environment-variable-driven feature toggles and provider integrations.
For details, see Vercel and Cloud Deployment.
The official Docker image lobehub/lobehub is built using a multi-stage process defined in the root Dockerfile. It produces a lightweight production image based on the scratch stage, containing the Next.js standalone server and necessary database migration scripts.
Sources: Dockerfile5-135 Dockerfile98-102 Dockerfile126-127
For details, see Docker Deployment.
For complex self-hosted environments, LobeHub provides a comprehensive Docker Compose orchestration. This includes not just the application container, but also the full infrastructure stack required for advanced features like RAG and authentication.
| Service | Responsibility | Image / Reference |
|---|---|---|
| PostgreSQL | Primary data storage with pgvector and pg_search | paradedb/paradedb:latest-pg17 |
| RustFS | S3-compatible file storage | docs/self-hosting/platform/docker-compose.zh-CN.mdx73-77 |
| LobeHub | Core application service | lobehub/lobehub |
| SearXNG | Search engine for plugin tools | docker-compose/deploy/searxng-settings.yml1-10 |
The setup.sh script is provided to automate the provisioning of these services, including generating necessary secrets like KEY_VAULTS_SECRET and AUTH_SECRET.
Self-Hosting Provisioning Flow
Sources: docker-compose/setup.sh35-65 docs/self-hosting/platform/docker.mdx74-94 docs/self-hosting/platform/docker-compose.zh-CN.mdx290-313
For details, see Docker Compose Self-Hosting.
LobeHub is distributed as a native desktop application using Electron. The build pipeline packages the application for macOS, Windows, and Linux.
The desktop app differs from the web version by providing:
stdio.Desktop Build and Release Workflow
Sources: Dockerfile77-78 docs/self-hosting/environment-variables/basic.mdx112-127
For details, see Desktop Application Distribution.