Clone
4
Self Hosting
hobokenchicken edited this page 2026-07-06 14:06:18 -04:00
Self-Hosting
Docker Compose (full stack)
make docker-up
This starts:
app- Go backend + built web frontendpostgres- PostgreSQL 16valkey- Redis-compatible cacheminio- S3-compatible file storagelivekit- WebRTC SFU for voice/videocoturn- TURN/STUN for NAT traversalcaddy- Reverse proxy with auto-TLS (prod) or HTTP (dev)
Environment variables
Copy .env.example to .env and set:
# App
DUMPSTER_HOST=chat.your.domain
DUMPSTER_PORT=8080
DUMPSTER_SECRET=<random>
# Database
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=dumpster
POSTGRES_PASSWORD=<random>
# Cache
VALKEY_URL=redis://valkey:6379
# File storage (optional)
MINIO_ENDPOINT=minio:9000
MINIO_ACCESS_KEY=<random>
MINIO_SECRET_KEY=<random>
# Voice/video (optional)
LIVEKIT_API_KEY=<random>
LIVEKIT_API_SECRET=<random>
# Giphy (optional)
GIPHY_API_KEY=<your-key>
# Push notifications (optional)
VAPID_PUBLIC_KEY=<generated>
VAPID_PRIVATE_KEY=<generated>
VAPID_SUBJECT=admin@your.domain
Ports required
| Port | Service |
|---|---|
| 80/443 | Caddy reverse proxy |
| 7880-7882 | LiveKit signaling and media |
| 3478/udp | coturn TURN |
| 5349 | coturn TURN TLS |
| 50000-50100/udp | LiveKit relay |
| 10000-20000/udp | coturn media relay |
First run
# Start services
docker compose -f docker/compose.yml up -d
# Run migrations (creates tables)
go run ./cmd/migrate up
# Start the server
go run ./cmd/server
# In dev, start the web frontend separately
cd web && npm install && npm run dev
Production TLS
For production, update docker/Caddyfile:
chat.your.domain {
reverse_proxy /api/* app:8080
reverse_proxy /ws app:8080
reverse_proxy /ws/bot app:8080
reverse_proxy /webhooks/* app:8080
reverse_proxy /files/* app:8080
root * /srv/web
file_server
}
Remove auto_https off and Caddy will fetch Let's Encrypt certificates.
Adding bots
- Create a bot via the web UI (
/botspage) - Copy the bot token (shown once)
- Add the bot to a server
- Run the bot:
BOT_TOKEN=*** go run ./examples/modbot/main.go
Webhooks
- Create a webhook via the API or web UI
- Copy the webhook URL (includes token)
- POST to the URL:
curl -X POST https://chat.your.domain/webhooks/<id>/<token> \ -H "Content-Type: application/json" \ -d '{"content": "Hello from webhook!", "username": "GitHub"}'
Push notifications
To enable push notifications:
-
Generate VAPID keys:
go run ./cmd/keygen -
Add to
.env:VAPID_PUBLIC_KEY=<generated> VAPID_PRIVATE_KEY=<generated> VAPID_SUBJECT=admin@your.domainSet
VAPID_SUBJECTto your email address without themailto:prefix (the library adds it automatically). -
Users are auto-subscribed on login. On iOS, the prompt requires a tap gesture (a banner appears). On Android, notifications deliver through FCM when Chrome is running. Ensure Chrome battery optimization is set to Unrestricted for reliable delivery when the PWA is closed.
Roles & permissions
Default roles are seeded when creating a server:
@everyone- Basic permissions (view, send, voice)- Server owner can create additional roles via
/servers/:id/roles
Permission bits:
- VIEW_CHANNEL (1), SEND_MESSAGES (2), MANAGE_MESSAGES (4)
- KICK_MEMBERS (8), BAN_MEMBERS (16)
- MANAGE_SERVER (32), MANAGE_CHANNELS (64), ADMINISTRATOR (128)
- CONNECT_VOICE (256), SPEAK_VOICE (512), SHARE_SCREEN (1024)
TUI client
# Build
make build-tui
# Run with env vars
DUMPSTER_SERVER=https://chat.your.domain \
DUMPSTER_TOKEN=*** \
./dumpster-tui
# Or with config file (~/.config/dumpster/config.yaml)
./dumpster-tui