# LobeHub（Lobe Chat） — self-hosting guide (Docker Compose + reverse proxy)

> Open-source AI chat / agent platform (formerly Lobe Chat). The official compose bundles PostgreSQL, Redis, RustFS, SearXNG and more.

- Page: https://deploy.cc/en/apps/lobehub
- Category: AI & automation
- Server: No official minimum; our generic suggestion: 2 vCPU / 4 GB RAM and up (not an official figure)
- Ports: 3210 (Web)
- Repository: https://github.com/lobehub/lobehub
- Docs: https://lobehub.com/docs/self-hosting/start
- Deploy source: https://github.com/lobehub/lobehub/blob/main/README.md
- Verification: official method (not modified or run by us)
- Last verified: 2026-11-13

## Official install steps

```bash
mkdir -p /opt/lobehub && cd /opt/lobehub
bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN   # 官方示例为 -l en
docker compose up -d
```

## Notes

- The official command downloads lobe.li/setup.sh which generates compose and config in the current directory; review it first if you like.

## Nginx

```nginx
# LobeHub（Lobe Chat） 反向代理 / reverse proxy — generated by deploy.cc
# 把 example.com 换成你的域名，证书路径按实际修改（certbot / acme.sh 签发）。
# Replace example.com and the certificate paths. More options: https://nginx.cc/zh/gen
# 放到 /etc/nginx/conf.d/<name>.conf，然后 nginx -t && systemctl reload nginx

map $http_upgrade $connection_upgrade_lobehub {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    listen [::]:80;
    server_name example.com;

    location /.well-known/acme-challenge/ {
        root /var/www/html;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;  # nginx < 1.25.1: 删除此行，改为 listen 443 ssl http2;
    server_name example.com;

    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;

    client_max_body_size 100m;

    location / {
        proxy_pass http://127.0.0.1:3210;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade_lobehub;
        proxy_read_timeout 3600s;
        proxy_buffering off;  # 流式输出 / streaming responses
    }
}
```

## Caddy

```caddy
# LobeHub（Lobe Chat） — Caddyfile (deploy.cc). Caddy 会自动申请 HTTPS 证书 / automatic HTTPS
example.com {
    reverse_proxy 127.0.0.1:3210
}
```

## Update

```bash
cd /opt/lobehub && docker compose pull && docker compose up -d
```

## FAQ

### What is LobeHub（Lobe Chat）?

Open-source AI chat / agent platform (formerly Lobe Chat). The official compose bundles PostgreSQL, Redis, RustFS, SearXNG and more. Repository: https://github.com/lobehub/lobehub

### What server do I need for LobeHub（Lobe Chat）?

No official minimum; our generic suggestion: 2 vCPU / 4 GB RAM and up (not an official figure)

### Which ports does LobeHub（Lobe Chat） use?

3210 (Web)

### How do I update LobeHub（Lobe Chat）?

cd /opt/lobehub && docker compose pull && docker compose up -d. Back up and read the release notes before major upgrades.

---
deploy.cc (unofficial; trademarks belong to their owners) · v0.2.2
