self host livekit server caddy fail to generate ce...
# ask-ai
r
self host livekit server caddy fail to generate certificate sudo systemctl status livekit-docker ● livekit-docker.service - LiveKit Server Container Loaded: loaded (/etc/systemd/system/livekit-docker.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2025-10-02 055422 UTC; 21min ago Process: 31623 ExecStartPre=/usr/local/bin/docker-compose -f docker-compose.yaml down (code=exited, status=0/SUCCESS) Main PID: 31632 (docker-compose) Tasks: 9 (limit: 9388) Memory: 9.8M CPU: 275ms CGroup: /system.slice/livekit-docker.service └─31632 /usr/local/bin/docker-compose -f docker-compose.yaml up Oct 02 061507 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385707.761145,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"vc-whip.liveapp.go.tz","issuer":"acme-v02.api.lets> Oct 02 061507 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"warn","ts":1759385707.7613947,"logger":"tls","msg":"missing email address for ZeroSSL; it is strongly recommended to set one for next time"} Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385708.0758963,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"vc-whip.liveapp.go.tz","issuer":"acme.zerossl.com> Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385708.075989,"logger":"tls.obtain","msg":"will retry","error":"[vc-whip.liveapp.go.tz] Obtain: account pre-registration callback: failed getting > Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385708.745599,"logger":"tls.acme_client","msg":"challenge failed","identifier":"vc-turn.liveapp.go.tz","challenge_type":"tls-alpn-01","problem":{"> Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385708.745652,"logger":"tls.acme_client","msg":"validating authorization","identifier":"vc-turn.liveapp.go.tz","problem":{"type":"urnietfparams:> Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385708.7456796,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"vc-turn.liveapp.go.tz","issuer":"acme-v02.api.let> Oct 02 061508 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"warn","ts":1759385708.7458289,"logger":"tls","msg":"missing email address for ZeroSSL; it is strongly recommended to set one for next time"} Oct 02 061509 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385709.2947333,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"vc-turn.liveapp.go.tz","issuer":"acme.zerossl.com> Oct 02 061509 vcLiveKit docker-compose[31632]: livekit-caddy-1 | {"level":"error","ts":1759385709.2948105,"logger":"tls.obtain","msg":"will retry","error":"[vc-turn.liveapp.go.tz] Obtain: account pre-registration callback: failed getting> lines 1-21/21 (END) any in sight on how to succeed hosting
t
Thanks for reaching out, Jovinary. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you please share a bit more about your Caddy configuration and how your domain is set up? For instance, are you using DNS-based challenges, and have you had a chance to configure the necessary DNS records for the domains like vc-whip.liveapp.go.tz and vc-turn.liveapp.go.tz? I’m here to help you through this!
r
juvenery@vcLiveKit:~/vc.liveapp.go.tz$ cat caddy.yaml logging: logs: default: level: INFO storage: "module": "file_system" "root": "/data" apps: tls: certificates: automate: - vc.liveapp.go.tz - vc-turn.liveapp.go.tz - vc-whip.liveapp.go.tz layer4: servers: main: listen: [":443"] routes: - match: - tls: sni: - "vc-turn.liveapp.go.tz" handle: - handler: tls - handler: proxy upstreams: - dial: ["localhost:5349"] - match: - tls: sni: - "vc.liveapp.go.tz" handle: - handler: tls connection_policies: - alpn: ["http/1.1"] - handler: proxy upstreams: - dial: ["localhost:7880"] - match: - tls: sni: - "vc-whip.liveapp.go.tz" handle: - handler: tls connection_policies: - alpn: ["http/1.1"] - handler: proxy upstreams: - dial: ["localhost:8080"] juvenery@vcLiveKit:~/vc.liveapp.go.tz$ cat caddy-internal.yaml # caddy-internal.yaml # Config for private domain vc.liveapp.go.tz (10.80.80.250) logging: logs: default: level: INFO apps: tls: certificates: automate: # The 'internal' directive is KEY. It tells Caddy to generate self-signed certs for these domains. - domains: ["vc.liveapp.go.tz"] internal: true - domains: ["vc-turn.liveapp.go.tz"] internal: true - domains: ["vc-whip.liveapp.go.tz"] internal: true layer4: servers: main: listen: [":443"] routes: # Route 1: TURN TLS (for vc-turn.liveapp.go.tz:5349) - match: - tls: sni: - "vc-turn.liveapp.go.tz" handle: - handler: tls - handler: proxy upstreams: - dial: ["localhost:5349"] # Route 2: Main LiveKit Server (for vc.liveapp.go.tz:7880) - match: - tls: sni: - "vc.liveapp.go.tz" handle: - handler: tls connection_policies: - alpn: ["http/1.1"] - handler: proxy upstreams: - dial: ["localhost:7880"] # Route 3: WHIP Ingress (for vc-whip.liveapp.go.tz:8080) - match: - tls: sni: - "vc-whip.liveapp.go.tz" handle: - handler: tls connection_policies: - alpn: ["http/1.1"] - handler: proxy upstreams: - dial: ["localhost:8080"]
t
To help you resolve the Caddy certificate generation issue, let's walk through a few steps together: 1. Verify DNS Records: Could you please check that your domains (like vc-whip.liveapp.go.tz, vc-turn.liveapp.go.tz) are correctly pointing to your server's IP address? Tools such as
dig
or
nslookup
can be really handy for this. 2. Check Domain Accessibility: It's important that your domains are publicly accessible and that ports 80 and 443 are open, as these are needed for ACME challenges to work smoothly. 3. Review Caddy Configuration: Take a moment to look over your
caddy.yaml
and
caddy-internal.yaml
files. Make sure the domains listed under
certificates
align perfectly with your DNS setup. 4. Inspect Logs: You can run
docker-compose logs caddy
to see if there are any specific errors related to certificate provisioning. This often gives great clues. 5. Restart Services: After making any adjustments, please restart the LiveKit Docker services with
sudo systemctl restart livekit-docker
to apply the changes. 6. Test Configuration: If you want, you can also manually validate the Caddy configuration by running:
Copy code
bash docker-compose run --rm caddy caddy validate --config /etc/caddy/Caddyfile
If you run into any specific errors or feel stuck at any point, just let me know—I’m here to help you through it! Sources: Deploy to a VM | LiveKit Docs
r
the caddy issue has been resolved but during test i get this result Connecting to signal connection via WebSocket Connected to server, version 1.9.0. Establishing WebRTC connection udp 101.203.3.168:50654 host tcp 101.203.3.168:7881 host (passive) udp 101.203.3.168:56739 host udp 101.203.3.168:51961 host tcp 101.203.3.168:7881 host (passive) udp 101.203.3.168:51099 host Warning: ports need to be open on firewall in order to connect. Error: could not establish pc connection Can connect via TURN Error: could not establish pc connection Can publish audio Error: could not establish pc connection Can publish video Error: could not establish pc connection Resuming connection after interruption Error: could not establish pc connection FAIL
t
To help you with the WebRTC connection issues, let's go through these steps together: 1. Verify Network and Firewall Settings: - Please make sure that UDP ports 50,000–60,000 (or the range you have set) are open for inbound traffic. - Also, open TCP port 7881 for fallback connections if UDP happens to be blocked. - Don’t forget to check that ports 80 and 443 are open for signaling and TURN over TLS. 2. Check STUN/TURN Configuration: - Take a moment to verify that your TURN server is properly set up in the
config.yaml
file. Here’s an example to guide you:
Copy code
yaml turn_servers: - host: your-turn-server.com port: 443 protocol: tls username: "your-username" credential: "your-password"
- Also, ensure your TURN server is reachable and that the SSL certificates are valid. 3. Enable External IP Discovery: - If your server is behind NAT, it’s important to enable external IP discovery in your configuration like this:
Copy code
yaml rtc: use_external_ip: true
4. Inspect Logs and ICE Candidates: - Check the client-side logs for ICE candidate types. If you notice missing UDP or TURN candidates, that might point to configuration or network issues. - You can also use tools like the [WebRTC Trickle ICE sample](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/) to test your STUN/TURN setup. 5. Restart Services: - After making these changes, please restart the LiveKit Docker services with this command:
Copy code
bash sudo systemctl restart livekit-docker
6. Run Connection Diagnostics: - Try using the LiveKit connection test utility to help diagnose any WebSocket, WebRTC, or TURN connectivity problems. If you run into any specific errors or need a hand at any step, just let me know — I’m here to help! Sources: Connecting to LiveKit | LiveKit Docs | Diagnosing Connection Errors with Connection Test Utility | src/connectionHelper/checks/webrtc.ts | Getting Help & Troubleshooting | livekit/livekit_composite | DeepWiki | test/singlenode_test.go