WebRTC fails differently from a website. The page loads, the join button works, the signalling WebSocket connects, and then two people stare at black rectangles because the media path, which runs over different ports and usually a different protocol, never came up. Nothing returned a 500. For the fraction of users behind a strict firewall, the path goes through a TURN relay, and a broken relay means those users, and only those users, cannot connect.
This guide sets up external monitoring for the two pieces most self-hosted stacks run: LiveKit server and coturn. It is honest about the limit: an uptime monitor can check HTTP and open TCP ports, and WebRTC media is mostly UDP. So the plan has two layers: outside checks for everything reachable, and a small cron canary that makes a real allocation and reports through a heartbeat. HTTP monitors run on CronAlert's free plan; TCP monitors, keyword assertions, and heartbeats are Pro ($5/month) and are marked.
What each service exposes
| Target | Default port | Protocol | What to check |
|---|---|---|---|
| LiveKit API and signalling | 7880 (behind a TLS load balancer) | HTTP / WebSocket | GET / returns 200 OK, or 406 Not Ready |
| LiveKit ICE/TCP | 7881 | TCP | TCP monitor. Cannot sit behind a load balancer or TLS |
| LiveKit ICE/UDP | 50000–60000, or a single mux port such as 7882 | UDP | Not checkable from outside; canary only |
| LiveKit embedded TURN | 5349 TLS, 3478 UDP (off by default) | TLS / UDP | TCP monitor on the TLS port |
| coturn | 3478 (UDP and TCP), 5349 (TLS) | STUN/TURN | TCP monitors; no HTTP response by default |
| coturn relay range | 49152–65535 | UDP | Canary only |
| coturn Prometheus | 9641 (off by default) | HTTP | GET / returns 200 ok |
The port numbers are the defaults from LiveKit's ports documentation and coturn's sample configuration; yours may differ, and LiveKit's docs note that the TURN TLS port must be 443 if you are not putting a load balancer in front of it.
Step 1: LiveKit's health response
LiveKit server answers a plain GET / on its signalling port. In the server source the handler returns 200 with the body OK, unless the node's stats have not been updated for more than four seconds, in which case it returns 406 with a body beginning Not Ready. Any other unknown path is a 404. That gives an outside monitor a real signal: the process is running and its internal loop is alive.
- Add an HTTP monitor on
https://livekit.example.com/, the public hostname your clients use (LiveKit's docs say the API port should sit behind a load balancer that terminates TLS). Expected status200, timeout10seconds. - On Pro, add contains
OK. Without it, a proxy that serves a default page with 200 when the backend is missing would pass; in practice the more common failure is a 502 from the proxy, which the status check already catches.
This one monitor covers DNS, the certificate on the signalling hostname (SSL monitoring is included on every plan), the load balancer, and the server. On a multi-node deployment the load balancer picks a node, so a single unhealthy node shows up as intermittent 406s in the check history before it becomes an incident. If you can address nodes individually, give each its own monitor.
Step 2: prove the auth path with an inverse monitor
The root path does not touch token validation. /rtc/validate does: it is the route clients use to check a token before connecting. With no token, the server answers 401 with the body permissions denied. That is a useful thing to assert on purpose:
- Add an HTTP monitor on
https://livekit.example.com/rtc/validatewith expected status401. - On Pro, add contains
permissions denied.
A 401 from LiveKit itself proves the request got through the proxy to the RTC service's routing and that its auth middleware is running. If the proxy's routing for /rtc breaks (the classic mistake after an nginx or Caddy change is forwarding / and forgetting WebSocket upgrade paths), this monitor goes red while the root path stays green. Expected-status monitors on a 401 are covered in custom headers and expected status codes.
Do not put a real access token in a monitor to make this return 200. Tokens are short-lived by design, and a long-lived one in a monitor's headers is a standing credential to join rooms.
LiveKit's server API (listing rooms, participants) is Twirp, which per its docs expects an HTTP POST with a JSON body and a bearer token. HTTP monitors send no request body, so those endpoints belong in the canary in step 5, not in a monitor.
Step 3: TCP monitors for the ports that are not HTTP (Pro)
Create a TCP monitor for each TCP listener your clients need. A TCP monitor is up when a connection to host:port opens within the timeout.
livekit.example.com:7881: ICE over TCP, which LiveKit's docs describe as the path used when a client cannot connect over UDP (VPNs, corporate firewalls). It bypasses the load balancer, so it tests the node's own firewall rule.turn.example.com:5349: TURN over TLS, the last-resort path for the most restricted networks. If you run TURN on 443, monitor that.turn.example.com:3478: TURN over TCP on coturn.
Two cautions. coturn starts UDP, TCP, and TLS listeners by default, but no-tcp and no-tls in turnserver.conf turn them off; if your config sets either, the matching TCP monitor will be red by design, so only monitor the listeners you run. And a TCP monitor tells you the port accepts connections, nothing more: it does not speak STUN, check credentials, or validate the certificate. It catches a dead process, a closed firewall rule, and a host that is down, which are the common failures, and misses the subtle ones in step 5.
UDP cannot be checked from outside at all: CronAlert does TCP and HTTP, not UDP or ICMP. For most deployments UDP is the primary media path, which is the reason the canary exists.
Step 4: coturn's one HTTP endpoint
coturn does not answer HTTP on its TURN listeners by default, so pointing an HTTP monitor at 3478 or 5349 just times out. It does have an optional Prometheus exporter: started with --prometheus, it listens on port 9641, serves metrics at /metrics, and, per coturn's own option text, the path / on that port can be used as a health check. In the source it returns 200 with the body ok.
Two things to know before using it. coturn's documentation says the exporter is unavailable in apt-packaged builds, so you may need the Docker image or your own build. And the exporter has no authentication and binds to all interfaces unless you set --prometheus-address, so do not expose 9641 to the internet as-is. The clean way is a reverse proxy route that forwards only / (not /metrics) from something like https://turn.example.com/healthz to 127.0.0.1:9641/, then an HTTP monitor on that URL expecting 200, with contains ok on Pro. If that is more plumbing than you want, the TCP monitors plus the canary cover coturn without it.
Step 5: the canary that makes a real allocation (Pro)
The failures that actually break calls leave every port open: a wrong external-ip behind NAT (coturn returns that value to clients as the relay address, so a wrong one yields relay candidates that go nowhere), a closed UDP relay range, an expired or mismatched shared secret. Catching them requires doing what a client does. coturn ships the tools:
#!/usr/bin/env bash
# /usr/local/bin/turn-canary.sh — run from a machine OUTSIDE the TURN server's network
set -uo pipefail
TURN=turn.example.com
# 1. STUN binding over UDP: exits 1 on timeout or receive error
turnutils_stunclient -p 3478 "$TURN" >/dev/null || exit 1
# 2. A real TURN allocation with relayed traffic.
# -y client-to-client (no external peer needed), -n message count,
# -W the TURN REST API shared secret (use -u/-w for static users)
OUT=$(turnutils_uclient -y -n 10 -c -W "$TURN_SECRET" -u canary "$TURN" 2>&1)
echo "$OUT" | grep -q "THE-SUCCESS-LINE-YOUR-VERSION-PRINTS" || exit 1
curl -fsS --max-time 10 --retry 3 https://cronalert.com/api/heartbeat/YOUR-TOKEN Run it by hand first, once against the working server and once with a wrong secret, and pick the line to grep from the difference in output. We could confirm from the source that turnutils_stunclient returns 1 on a timeout, but not that turnutils_uclient exits non-zero on a failed allocation in every version, so match on its output and do not trust the exit code alone. Add -t for TURN over TCP or -S -p 5349 for TLS if those are the paths your users depend on.
Schedule it every five minutes and create a heartbeat monitor with a 5-minute expected interval and a 10-minute grace, so one lost packet does not page you and two missed runs do. Where it runs matters: on the TURN host itself it tests nothing about NAT or the firewall. A small VPS in another network, or a CI runner on a schedule, is the right place. Cron job heartbeat monitoring covers the pattern.
For LiveKit the equivalent is the lk CLI, which reads LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET from the environment:
# API path: authenticates and lists rooms over the server API
lk room list >/dev/null && \
curl -fsS --max-time 10 --retry 3 https://cronalert.com/api/heartbeat/API-TOKEN
# Media path: publish and subscribe in a throwaway room for 20 seconds
lk perf load-test --room canary --duration 20s --audio-publishers 1 --subscribers 1 > /tmp/lk-canary.log 2>&1 The first line is the cheap, frequent check: it proves key validation and the server API, and on a multi-node install it exercises Redis, which LiveKit requires as its shared store and message bus in distributed mode. The load test joins a real room and moves real media; confirm on your version how it reports failure (exit status or summary output) before wiring it to a second heartbeat, and run it every 15 minutes or so, not every minute. Give the canary its own API key so it can be revoked without touching production.
Step 6: the certificate nobody watches (Pro)
The certificate on the signalling hostname is covered by the HTTP monitor in step 1. The certificate on the TURN TLS port is a different listener, often a different hostname, and no HTTPS check on 443 sees it. When it expires, only the users who needed TURN over TLS fail, which makes it a slow, confusing outage. Check it from the same canary host:
# Daily: fail if the TURN TLS cert expires within 14 days (1209600 seconds)
echo | openssl s_client -connect turn.example.com:5349 -servername turn.example.com 2>/dev/null \
| openssl x509 -noout -checkend 1209600 \
&& curl -fsS --max-time 10 --retry 3 https://cronalert.com/api/heartbeat/CERT-TOKEN A heartbeat with a 1-day interval and a few hours of grace alerts two weeks before expiry. The usual cause is not a failed renewal but a successful one that the server never picked up: the new file is on disk and coturn is still serving the old certificate from memory. coturn's source installs a SIGUSR2 handler that reloads certificates and keys, though we did not find that in its documentation, so the safe renewal hook is the one you have tested: a restart, or the signal after confirming it works on your version. Monitoring Let's Encrypt renewals covers the hook side. For LiveKit's embedded TURN, the docs note that turn.domain must match the certificate's domain.
Egress and Ingress
If you record or stream rooms with LiveKit Egress, or accept RTMP or WHIP with Ingress, those are separate services that both require Redis, and each has a health port that is off or unset until you configure it.
- Egress: with
health_portset, any path returns 200 with a JSON status that includes the CPU load. The handler does not return a non-200 under load, so it is a liveness check: it tells you the process exists. The real signal that egress works is a recording appearing, so if recordings matter, have the job that processes finished recordings ping a heartbeat. - Ingress: the health port's
/always answers 200Healthy, and/availabilityanswers503when the service cannot accept more work. Assert on the status code there, not on a keyword. Its RTMP port (1935 by default) is a good target for a TCP monitor if it is exposed publicly.
Health ports are meant for the orchestrator and are usually internal. Reach them the same way as any private service: a cron job inside the network that curls the port and pings a heartbeat on success, as in monitoring internal tools.
What not to monitor
- The metrics ports directly. LiveKit's Prometheus port is unauthenticated unless you set
prometheus.usernameandprometheus.password, and coturn's has no auth at all. Neither should be reachable from the internet just so a monitor can see it. - The TURN ports with an HTTP monitor. coturn sends nothing HTTP-shaped back by default; the check will time out forever. (An opt-in setting makes it answer 400, which is still not a health signal.)
- A public "join" page as a proxy for media. It is worth a monitor as a web page, but its 200 says nothing about whether a call would connect.
- Redis from outside. LiveKit's API canary already depends on it in distributed mode. Monitoring Redis covers the right ways if you want it separately.
Reading an alert
| Alert | Likely cause | First thing to check |
|---|---|---|
Root path: Expected status 200, got 502 | LiveKit process down or restarting | Container or service status |
Root path: Expected status 200, got 406 | Node not ready: its stats loop has stalled | Server logs; CPU and Redis connectivity |
Root path green, /rtc/validate not 401 | Proxy routing for /rtc broken | Proxy config after the last change |
| TCP 7881 down, HTTP green | Firewall rule or security group removed | Node firewall; the port bypasses the load balancer |
| TCP 3478 / 5349 down | coturn stopped, or listener disabled in config | systemctl status coturn; no-tcp / no-tls |
| All ports green, TURN canary overdue | Wrong external-ip, UDP relay range closed, secret mismatch | Run the canary by hand and read the output |
lk room list heartbeat overdue | API keys changed, Redis down, server API unreachable | Run it by hand; Redis |
| Certificate heartbeat overdue | TURN certificate near expiry, or renewed but not reloaded | Renewal hook; restart or reload coturn |
Frequently asked questions
Is one HTTP monitor on LiveKit enough?
It is enough to know the server is up, and it is free. It is not enough to know calls work. If you add one thing, add the TURN allocation canary: it tests the part of the stack with no other visibility.
Can I monitor UDP ports?
Not from CronAlert, and not reliably from any outside prober: UDP has no connection to open, so "no reply" is ambiguous. A protocol-level client (turnutils_stunclient, turnutils_uclient, or a LiveKit load test) is the only real UDP check.
My TURN server is on a bare IP address. Does that work?
TCP monitors can target a public IP directly. HTTP monitors need a hostname, so give anything you want to check over HTTP a DNS name.
Does this apply to Jitsi, Nextcloud Talk, or Matrix calls?
The coturn half applies unchanged, since all three commonly use coturn for TURN. The signalling half differs per product; see Nextcloud and Matrix Synapse for those.
How often should the canaries run?
The TURN and API canaries every five minutes, the media load test every fifteen, the certificate check daily. Set each heartbeat's interval to match and the grace to one or two intervals.
Get started
Start with the two free monitors: the root path expecting 200 and /rtc/validate expecting 401. Create a free CronAlert account and add them, then put the TURN canary on a machine outside your network. Related reading: monitoring WebSocket endpoints, TCP port monitoring, monitoring game servers, monitoring reverse proxies, and monitoring Docker self-hosted services.