Why self-host Lobe Chat on a VPS
Lobe Chat aggregates several LLM providers (OpenAI, Anthropic, Google, Mistral, local Ollama) in a single UI with a plugin marketplace, custom agents and voice recognition/synthesis. In SaaS, your histories and your keys pass through a third party; by hosting it on your own VPS, conversations stay in your PostgreSQL database and your API keys never leave your server. A VPS also offers a fixed IP useful for whitelisting your outbound calls to paid APIs, and the freedom to enable database mode (multi-user with authentication) rather than simple browser storage.
Concrete benefits of self-hosting
- Centralization of all your LLM API keys on the server side, never exposed to the browser
- Conversation histories persisted in your own PostgreSQL, backable up and encryptable
- Multi-user mode via authentication (Logto, Auth0, Clerk) for a whole team
- Connection to a local Ollama on the same VPS for 100% private responses with no API cost
- Marketplace of plugins and custom agents with no quota or limit imposed by a SaaS
- Full cost control: you only pay for the actual consumption of the APIs you connect
Hardware and software requirements
Lobe Chat is a relatively lightweight Node.js application. In browser storage mode, 1 vCPU and 1 GB of RAM are enough. For database mode (recommended in production) with embedded PostgreSQL, plan for 2 vCPU and 2 to 4 GB of RAM, plus 10 GB of disk for images, attachments and the database. On the software side: Docker and the Docker Compose plugin, a domain name pointing to the VPS IP (A record), and at least one API key from an LLM provider. If you enable S3 mode for files, plan for a compatible bucket (MinIO can run on the same VPS).
Deployment of Lobe Chat with Docker
Prepare the VPS and Docker
Connect over SSH, update the system then install Docker via
curl -fsSL https://get.docker.com | sh. Verify the installation withdocker compose version. Create a working folder:mkdir -p /opt/lobe-chat && cd /opt/lobe-chat.Write the compose file in database mode
Create a
docker-compose.ymlwith thelobe-chat-databaseservice, apostgresservice (imagepgvector/pgvector:pg16) andminiofor S3 storage. Fill in the variablesDATABASE_URL,KEY_VAULTS_SECRET(generated withopenssl rand -base64 32) andNEXT_AUTH_SECRET.Inject the keys and the auth provider
Add your keys in a
.envfile:OPENAI_API_KEY,ANTHROPIC_API_KEY, etc. ConfigureNEXT_AUTH_SSO_PROVIDERSand the Logto or Clerk credentials to enable multi-user authentication before public exposure.Launch the stack
Start everything with
docker compose up -d. Follow the logs withdocker compose logs -f lobe-chat-databaseuntil you see the server listening on port 3210.Set up the reverse proxy and SSL
Place Caddy or Nginx in front of the container. With Caddy, a three-line Caddyfile (
chat.yourdomain.com { reverse_proxy localhost:3210 }) automatically generates the Let's Encrypt certificate and forces HTTPS.Verify and secure
Open
https://chat.yourdomain.com, create the first administrator account, then close port 3210 at the firewall (ufw deny 3210) to let only traffic through the reverse proxy pass.
For totally private conversations with no API cost, install Ollama on the same VPS and set OLLAMA_PROXY_URL=http://host.docker.internal:11434/v1 in Lobe Chat. You get a local assistant (Llama 3, Qwen, Mistral) that depends on no external provider. Remember to increase the VPS RAM according to the size of the loaded model.
One-click Lobe Chat deployment on ServOrbit
Lobe Chat is available directly from the ServOrbit Marketplace. Select the application when ordering your VPS: Docker comes pre-installed, the Lobe Chat container starts automatically on port 3210, and you access it from your ServOrbit dashboard via an SSH tunnel or by attaching a domain — no Compose editing or manual SSL setup needed. To get started, all you need is your LLM API key (OpenAI, Anthropic, Mistral, or a local Ollama on the same VPS): configure it under Settings → Providers and ask your first question.