Caddy is the simplest way to put ChatbotX behind a reverse proxy. It handles TLS certificates automatically via Let’s Encrypt with zero extra configuration. ChatbotX exposes two services that need to be proxied:Documentation Index
Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
| Service | Internal port | Recommended subdomain |
|---|---|---|
| Builder (web UI + API) | 3123 | app.yourdomain.com |
| Realtime (WebSocket) | 1999 | ws.yourdomain.com |
| Storage (S3 API + assets) | 9000 | cdn.yourdomain.com |
Caddyfile
Public domain (Let’s Encrypt)
Caddy automatically provisions and renews TLS certificates for any public domain. No extra directives are needed.Caddyfile
Local / internal network (self-signed)
For private networks or development hosts that are not publicly reachable, usetls internal to generate a locally-trusted certificate with Caddy’s built-in CA.
Caddyfile
Browsers will show a certificate warning until you install Caddy’s root CA. Run
caddy trust to add it to your system trust store, then restart the browser.ChatbotX configuration
After setting up the proxy, update the following variables in your.env to use the public HTTPS URLs. Restarting the services picks up the new values.
.env
WebSocket support
Caddy’sreverse_proxy directive proxies WebSocket connections transparently — no additional configuration is required for PartySocket. The Upgrade and Connection headers are forwarded automatically.
Storage (RustFS / S3)
The storage service (RustFS) runs on port9000 and serves user-uploaded files and generated assets. Proxying it through Caddy gives you HTTPS asset URLs and avoids exposing the raw port to the internet.
Set NEXT_PUBLIC_ASSET_URL to the public path of your bucket’s public folder, and S3_ENDPOINT to the root of the storage domain so the Builder and Worker can upload files:
.env
The storage console (port
9001) does not need to be publicly exposed. Access it directly on the server with an SSH tunnel or restrict it to an internal network interface.Running Caddy with Docker Compose
If you run Caddy inside the same Docker Compose stack, use the container service name instead oflocalhost:
Caddyfile
docker-compose.yml