LobeHub is moving beyond the idea of a single chatbot window. Its current project describes an AI workspace for building, organizing, scheduling, and collaborating with agents, and it provides a self-hosted Docker deployment path. Running it yourself can keep conversations and workspace configuration closer to your infrastructure while allowing you to choose the model providers behind the interface.

This guide shows how to self-host LobeHub with Docker, connect an AI provider, protect the deployment, and operate it responsibly. LobeHub is actively developed, so treat its official repository and documentation as the source of truth for image names, environment variables, and release-specific changes. Do not paste an old Compose file into production without checking it against the current release.

What LobeHub is useful for

A normal chat interface is centered on one conversation. LobeHub adds a workspace model around agents and workflows. Depending on the version you deploy, you may use it to create specialized agents, organize projects, connect tools, and keep a consistent interface for different model providers.

That makes a private deployment useful for:

  • a personal AI workspace on a home server;
  • an internal team assistant with controlled access;
  • separate agents for coding, research, writing, and operations;
  • experimenting with multiple model APIs without giving every tool a separate public login;
  • keeping configuration and access policies under your own administration.

Self-hosting does not make a model private by itself. If you connect an external API, prompts and responses still travel to that provider. The privacy benefit is that your frontend, account layer, workspace settings, and optional local data are under your control. Read each provider’s retention and training policy before sending sensitive material.

Plan the deployment before starting

You need a Linux host with Docker Engine and the Compose plugin, a stable directory for deployment files, and enough memory for the web application plus any database or proxy you run beside it. LobeHub’s resource needs depend on the release and whether you use external services, local models, or additional integrations. A small VPS can work for a personal deployment, but leave headroom for updates and logs.

Choose how users will reach the service:

  • localhost or LAN: best for a first evaluation;
  • VPN-only: a strong default for a private team or homelab;
  • public HTTPS: requires a reverse proxy, authentication, firewall rules, monitoring, and a patch process.

Also decide whether model access will use a hosted provider or a local endpoint. Hosted providers are simpler but transmit prompts externally. Local inference can reduce that exposure, but it needs suitable hardware and changes your reliability and maintenance burden.

The private Open WebUI guide covers a different local-AI interface, while the LiteLLM gateway guide explains how to place a unified model gateway in front of multiple providers.

Use the official Docker image and release files

The LobeHub project publishes a Docker image and documents self-hosting in its repository and documentation. Start by creating a dedicated directory, then inspect the current release instructions before creating Compose files:

mkdir -p ~/lobehub
cd ~/lobehub

# Review the current release documentation first.
# Then create the Compose and environment files recommended by that release.

The exact image tag and environment variable names can change. Prefer a pinned stable tag over latest once you move beyond evaluation, because a floating tag can introduce an unexpected application update during a restart. Keep a redacted .env.example under version control and store the real secrets outside any public repository.

A minimal Compose shape may look like this, but confirm the image and variables against the current LobeHub release before using it:

services:
  lobehub:
    image: lobehub/lobehub:latest
    restart: unless-stopped
    ports:
      - "3210:3210"
    env_file:
      - .env

This is intentionally not a complete production recipe. The official project may require additional variables, a database mode, storage settings, or a different image name for your chosen release. Treat the generated official example as authoritative and validate it with docker compose config before starting containers.

Configure the model provider safely

A self-hosted interface still needs a model backend. LobeHub’s documentation describes provider configuration and commonly used API-key variables. Put keys in a protected environment file or a secrets manager, not directly into a committed Compose file or a chat transcript.

A safe workflow is:

chmod 700 ~/lobehub
chmod 600 ~/lobehub/.env

docker compose config >/tmp/lobehub-compose-check.yml
# Review the rendered configuration without publishing the temporary file.
docker compose up -d

Do not print the environment file in a support request. If you use an OpenAI-compatible endpoint, verify its base URL, model name, authentication method, and timeout behavior. A provider can return a successful health check while rejecting a particular model or context size.

For sensitive work, create separate provider keys with spending limits and revoke them independently. Keep billing alerts enabled. A private frontend does not protect you from an accidentally exposed key or an agent that calls a tool repeatedly.

Add a reverse proxy and HTTPS

For LAN-only access, binding the service to a private interface or firewall-restricted port may be enough. For a domain, put Caddy, Nginx, or another maintained proxy in front of LobeHub and terminate TLS there. Forward the headers and WebSocket behavior required by the current version, then test a complete conversation through the public hostname.

Your proxy should:

  1. redirect plain HTTP to HTTPS;
  2. obtain and renew certificates automatically;
  3. restrict the upstream port from the public internet;
  4. preserve the original host and scheme;
  5. apply sensible request-size and rate limits;
  6. emit access logs without capturing prompt bodies or authorization headers.

If the application generates links to localhost or the browser reports origin errors, check the deployment’s public URL and allowed-origin settings. The browser must see one consistent HTTPS origin from login through streaming responses and file uploads.

Protect accounts and agent tools

Complete first-run setup immediately. Use unique administrator credentials and create separate users rather than sharing one account. If the release supports additional authentication or an external identity provider, follow the current official documentation and test a recovery path before relying on it.

Agents deserve stricter controls than ordinary chat because they may call tools, read documents, or send requests. Start with no external tools, then enable only the integrations you understand. Use least-privilege tokens, restrict network access, and separate an experimental workspace from production data.

Avoid giving an agent a Docker socket, unrestricted shell access, or credentials that can modify your entire server. Prompt injection can arrive through a web page, uploaded file, email, or repository. Treat tool output as untrusted input and require confirmation for destructive or outbound actions.

Persistence and backups

Determine what the current LobeHub deployment stores locally and whether your chosen mode uses a database or external persistence. Back up configuration, user data, workspace content, and any encryption or authentication settings required to read that data. A Docker image is not a backup, and recreating a container does not restore deleted volumes.

Keep backups off the host and test them on a separate instance. A useful restore test answers these questions:

  • Can the service start with the restored configuration?
  • Can an administrator log in?
  • Are agents, projects, and conversation records present?
  • Do provider settings work without exposing the original keys?
  • Can you rotate the credentials after the restore?

If you do not need long-term conversation history, configure retention deliberately rather than allowing an unlimited database to grow silently. Document what gets sent to external model providers and how long local records remain available.

Upgrade without breaking the workspace

Before an upgrade, read the LobeHub release notes, record the current image tag, and take a verified backup. Pull the new image by its intended tag, recreate the service during a maintenance window, and inspect logs for migrations or environment changes.

A conservative sequence is:

cd ~/lobehub
docker compose pull
docker compose config >/tmp/lobehub-compose-check.yml
docker compose up -d
docker compose logs --tail=100 -f lobehub

Do not remove volumes as part of a routine upgrade. After the service is healthy, test login, a normal chat, streaming output, model selection, agent creation, file upload, and any enabled integration. Keep the previous image tag and backup until those checks pass.

Troubleshooting common failures

If the browser cannot connect, check docker compose ps, container logs, firewall rules, and whether port 3210 is already in use. If the page loads but model calls fail, verify the provider key, base URL, model identifier, quota, and server clock. If streaming stops behind a proxy, inspect WebSocket and buffering settings.

If login redirects to the wrong hostname, compare the public URL with the proxy’s scheme and host headers. If data disappears after recreation, inspect volumes and the deployment’s persistence settings before starting another container. Never run docker compose down -v while troubleshooting production data; the -v flag can remove volumes.

FAQ

Does self-hosting LobeHub mean the AI runs locally?

No. The interface can be self-hosted while the model runs through an external API. Local inference requires a compatible local model server and enough hardware.

Is LobeHub a replacement for ChatGPT?

It is an interface and agent workspace, not one model. Your experience depends on the providers and models you configure.

Can I expose it directly on port 3210?

For a temporary LAN test, perhaps. For internet access, use HTTPS through a maintained reverse proxy and firewall the upstream port.

Where should API keys go?

Use a protected environment file or secrets manager. Never commit keys, put them in screenshots, or print them in logs.

Should I use the latest Docker tag?

It is convenient for evaluation but less predictable for production. Pin a tested release tag and upgrade deliberately.

Final thoughts

Self-hosting LobeHub with Docker gives you a flexible private home for AI agents, but the container is only the beginning. Secure the provider keys, restrict tools, protect the public endpoint, back up persistent data, and test upgrades before users depend on the workspace. Start on a private network, understand where prompts travel, and add capabilities one permission at a time.

Source: LobeHub repository and self-hosting documentation