Files
lobehub__lobehub/docs/self-hosting/platform/dokploy.mdx
YuTengjing 191f3fe776 📝 docs: fix outdated content across the docs site (#16964)
* 📝 docs: fix outdated content across the docs site

Audited docs/ against the current codebase and fixed stale content that
drifted after major refactors (Clerk/NextAuth → Better Auth, src/server →
apps/server, src/{config,envs,locales} → packages/*, model-bank updates).

- self-hosting/auth: mark removed NextAuth/Clerk pages with deprecation
  warnings; fix microsoft/zitadel alias claims and the Logto callback path
- environment-variables & advanced: correct wrong defaults (S3_SET_ACL,
  AI_IMAGE_DEFAULT_IMAGE_NUM, index/proxy URLs), drop non-existent env vars
  and fictional feature flags, fix OIDC config guidance
- development: update refactored paths, Better Auth, .mjs configs, remove
  the MSW section (msw is not a dependency)
- providers & model examples: replace retired model ids with in-bank ones;
  fix comfyui frontmatter corruption
- usage: rename Moderator→Orchestrator, GTD→Task, correct shortcut keys,
  channel capability tables, Feishu/Lark WebSocket mode
- platform/migration: fix dead links, docker service name, npx/npm → bun

EN and zh-CN pairs updated together.

* 📝 docs: fix Logto callback path and AUTH_SECRET deprecation guidance

- Revert Logto/Sealos callback URLs to /api/auth/callback/logto to match
  the runtime SSO redirectURI override
- Narrow legacy auth Callout: AUTH_SECRET remains required for Better Auth;
  mark NEXT_AUTH_SECRET as deprecated in zh-CN

* 📝 docs: refresh agent skills for locales, env, auth, and agentRun paths

Align OSS agent guidance with post-refactor layout:
- packages/locales/src/default + bun run i18n
- packages/env/src for env schemas (@/envs alias)
- spa-auth shell + src/routes/auth segments
- chat agentRun/transports/hetero instead of aiChat

* 📝 docs: document APP_URL as required for Better Auth base URL

Self-hosted auth uses appEnv.APP_URL as baseURL, not request-header
auto-detection. NEXT_PUBLIC_AUTH_URL remains deprecated.

* 📝 docs: note self-host search provider setup for web search

Built-in lobe-web-browsing needs no client plugin, but self-hosted
servers still require SEARCH_PROVIDERS / SEARXNG_URL (default SearXNG).

* 📝 docs: point feature guide welcome UI at AgentHome

Opening message/questions on the agent chat page live in
src/features/AgentHome, not Onboarding WelcomeMessage.
2026-07-10 17:50:03 +08:00

137 lines
4.9 KiB
Plaintext

---
title: Deploy LobeHub with database on Dokploy
description: >-
Learn how to deploy LobeHub with database on Dokploy with ease, including:
database, authentication and S3 storage service.
tags:
- Deploy LobeHub
- Vercel Deployment
- OpenAI API Key
- Custom Domain Binding
---
# Deploying Server Database Version on Dokploy.
This article will detail how to deploy the server database version of LobeHub.
## 1. Preparation Work
### Deploy Dokploy and configure related settings.
```shell
curl -sSL https://dokploy.com/install.sh | sh
```
1. Connect your GitHub to Dokploy in the Settings / Git section according to the prompt.
![Connect GitHub to Dokploy](/blog/assets0f97d1dfccd5ba07172aff71ff9acd7b.webp)
2. Enter the Projects interface to create a Project.
![Create Project in Dokploy](/blog/assetsb26b68a4875a6510ddc202dd4b40d010.webp)
### Configure S3 Storage Service
In the server-side database, we need to configure the S3 storage service to store files. For detailed configuration instructions, please refer to the section [Configure S3 Storage Service](https://lobehub.com/docs/self-hosting/platform/vercel#3-configure-s3-storage-service) in the Vercel deployment guide。After the configuration is complete, you will obtain the following environment variables:
```shell
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_ENDPOINT=
S3_BUCKET=
S3_ENABLE_PATH_STYLE=
```
### Configure KEY\_VAULTS\_SECRET Environment Variable
`KEY_VAULTS_SECRET` is used to encrypt sensitive information such as API keys stored by users. Click the button below to generate:
<GenerateSecret envName="KEY_VAULTS_SECRET" />
### Configure authentication environment variables
Prepare the following authentication environment variables (powered by [Better Auth](https://www.better-auth.com)):
Click the button below to generate `AUTH_SECRET` (session encryption key):
<GenerateSecret envName="AUTH_SECRET" />
You also need to configure the `JWKS_KEY` environment variable for signing and verifying JWTs. Click the button below to generate:
<GenerateJWKSKey />
<Callout type={'info'}>
For advanced features like SSO providers, magic link login, and email verification, see [Authentication Service](/docs/self-hosting/auth).
</Callout>
## 2. Deploying the database on Dokploy
Enter the previously created Project, click on Create Service, and select Database. In the Database interface, choose PostgreSQL, then set the database name, user, and password. In the Docker image field, enter `paradedb/paradedb:latest-pg17`, and finally click Create to create the database.
![Create PostgreSQL Database in Dokploy](/blog/assets7006b60baaf62aa0d95cd40456e24afe.webp)
Enter the created database and set an unused port in External Credentials to allow external access; otherwise, LobeHub will not be able to connect to the database. You can view the Postgres database connection URL in External Host, as shown below:
```shell
postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
```
Finally, click Deploy to deploy the database.
![Deploy Database in Dokploy](/blog/assets1b9283f9cc5fc5073ff9cffc24880e96.webp)
## Deploy LobeHub on Dokploy.
Click "Create Service", select "Application", and create the LobeHub application.
![Create LobeHub Application in Dokploy](/blog/assetsb33085e7553d2b7194005b102184553e.webp)
Enter the created LobeHub application, select the forked lobehub project and branch, and click Save to save.
![Select Repository and Branch in Dokploy](/blog/assetsf0ebf396dbe9559eb3478f48f648a6e2.webp)
Switch to the Environment section, fill in the environment variables, and click Save.
![Configure Environment Variables in Dokploy](/blog/assets6b67dabe7b9226cdff1bace5a3b8ab18.webp)
```shell
# Environment variables required for building
NIXPACKS_PKGS="bun"
NIXPACKS_INSTALL_CMD="pnpm install"
NIXPACKS_BUILD_CMD="NODE_OPTIONS='--max-old-space-size=8192' pnpm run build"
NIXPACKS_START_CMD="pnpm start"
APP_URL=
# Configuration related to Postgres database
DATABASE_DRIVER=node
DATABASE_URL=
# Use the values generated above
KEY_VAULTS_SECRET=
AUTH_SECRET=
JWKS_KEY=
# S3 related configuration
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_ENDPOINT=
S3_BUCKET=
S3_ENABLE_PATH_STYLE=
```
After adding the environment variables and saving, click Deploy to initiate the deployment. You can check the deployment progress and log information under Deployments.
![Deploy LobeHub and View Progress](/blog/assets7c3eab218c0823fa353b1cd23afe21c3.webp)
After a successful deployment, bind your own domain to your LobeHub application and request a certificate on the Domains page.
![Bind Domain and Request Certificate](/blog/assetseebf66254337ce88357629c34e78c08d.webp)
## Check if LobeHub is working properly.
Go to your LobeHub website, and if you click on the login button in the upper left corner and the login pop-up appears normally, it means you have configured it successfully. Enjoy it to the fullest!
![LobeHub Login Success](/blog/assets11a8089b511aaa61e8982dea0a3665c5.webp)