DNS & TLS Setup Runbook
Domain Requirements
Yabanin requires 3 subdomains for production deployment (all with Caddy-managed TLS):
| Subdomain | Purpose | Service | Port |
|---|---|---|---|
api.yourdomain.com | Gateway — OpenAI-compatible API | gateway | 8082 → Caddy → 443 |
admin.yourdomain.com | Admin panel & billing UI | admin | 8086 → Caddy → 443 |
dash.yourdomain.com | Cost dashboard (React SPA) | dashboard-web | nginx → Caddy → 443 |
DNS Records
From your domain registrar, add three A-records pointing to the VPS IP:
Type Name Value TTL
A api <VPS_IP> 300
A admin <VPS_IP> 300
A dash <VPS_IP> 300
Replace <VPS_IP> with your actual VPS public IP address.
TLS / SSL
Caddy (via deploy/caddy/Caddyfile.tmpl) handles automatic HTTPS via Let's Encrypt. No manual certificate management needed — once DNS resolves, Caddy auto-provisions certs.
The gateway also receives its domains via environment variables:
API_DOMAIN→ defaults toapi.yourdomain.comADMIN_DOMAIN→ defaults toadmin.yourdomain.comDASHBOARD_DOMAIN→ defaults todash.yourdomain.com
Override these by setting the env vars in .env (copied to deploy/secrets/env) before deploying:
# deploy/secrets/env
API_DOMAIN=api.example.com
ADMIN_DOMAIN=admin.example.com
DASHBOARD_DOMAIN=dash.example.com
Deploy Sequence
- Purchase domain and note the IP address of your VPS
- Add DNS A-records (3 subdomains → VPS IP)
- Edit
deploy/secrets/envwith your actual domains - Run deploy:
./scripts/deploy.sh - Verify health checks — the script auto-checks all services
# After deploy, verify:
curl -sI https://api.yourdomain.com/v1/chat/completions | head -1
# Expected: HTTP/2 401 (unauthorized — API is up, no valid key)
Troubleshooting
Caddy not getting certificates
- Ensure DNS records propagate (
dig api.yourdomain.com) - Check Caddy logs:
docker compose logs caddy - Verify port 80/443 are open on the VPS firewall
- Let's Encrypt has rate limits — don't spam requests
Gateway can't reach domains
- Check gateway env vars in
.env(API_DOMAIN, ADMIN_DOMAIN) - Confirm Caddyfile.tmpl domain blocks match your DNS records