Jitsi Meet is easy to set up until a customer joins from behind a corporate firewall. Media goes over UDP, and plenty of networks only allow web traffic on port 443. Read Jitsi Meet and Firewalls first to see which ports Jitsi actually needs.
If you've opened everything you can and calls still fail for some people, the fix is a TURN server that relays their media over TCP 443. This guide sets up Coturn for Jitsi Meet with time-limited credentials, so nothing static ends up in client code. The same approach is in the official Jitsi handbook TURN guide. A TURN relay also hides participants' addresses, but browsers can still leak them; see how to stop WebRTC leaks.
Which port should TURN use?
Setting up Coturn
You can follow our How to Setup Coturn article and setup coturn with Time-Limited Credentials Mechanism and with SSL. You would have a coturn configuration file similar to the following one. On AWS, the quickest route is our one-click Coturn TURN server on AWS. Running on GCP instead of AWS? Our Coturn on GCP Marketplace deployment handles this same setup as a pre-configured image.
server-name=coturn.meetrix.io
realm=coturn.meetrix.io
cert=/etc/letsencrypt/live/coturn.meetrix.io/cert.pem
pkey=/etc/letsencrypt/live/coturn.meetrix.io/privkey.pem
fingerprint
listening-ip=0.0.0.0
external-ip=<EXTERNAL_IP>/<INTERNAL_IP> #or just the external ip
listening-port=443
min-port=10000
max-port=20000
log-file=/var/log/turnserver.log
verbose
static-auth-secret=<YOUR_SECRET> Configuring Prosody
Jitsi Meet asks the XMPP server for TURN credentials (XEP-0215), and current packages handle that with Prosody's mod_external_services, already enabled by default. You only need to tell it where your TURN server is and which shared secret Coturn's static-auth-secret uses. Open your Jitsi host config, usually /etc/prosody/conf.d/<your-domain>.cfg.lua, and edit the existing block rather than adding a second one:
external_service_secret = "<YOUR_SECRET>";
external_services = {
{ type = "stun", host = "coturn.meetrix.io", port = 443 },
{ type = "turn", host = "coturn.meetrix.io", port = 443, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" },
{ type = "turns", host = "coturn.meetrix.io", port = 443, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
}; Then restart Prosody with sudo systemctl restart prosody. Credentials now expire after ttl seconds (a day here), so there is nothing permanent to steal.
On an older install you may see mod_turncredentials instead, with turncredentials_secret and a turncredentials list in the same file. That's the module this guide originally used, and it works the same way. If you're setting up fresh, use the block above.
Jitsi Meet Config
A TURN server has two jobs in Jitsi: relaying peer-to-peer calls, and relaying traffic to the videobridge (JVB). Older Jitsi Meet versions needed useStunTurn set in two places of config.js. Recent versions fetch the TURN servers from Prosody on their own, so open your config.js first and only change the flag if it's there:
p2p: {
enabled: true,
preferH264: true,
useStunTurn: true, // Using Turn for p2p connections
stunServers: [
{ urls: "stun:stun.l.google.com:19302" },
{ urls: "stun:stun1.l.google.com:19302" },
{ urls: "stun:stun2.l.google.com:19302" }
]
},
useStunTurn: true, // Using Turn Server with JVB Overwhelmed with managing Jitsi Infrastructure?
Using Turn for p2p connections
Two-person calls go peer to peer. When the two browsers can't reach each other directly, useStunTurn: true in the p2p block lets them relay through your TURN server instead of failing.
Using Turn Server with JVB
With three or more people everything goes through the bridge. Set top-level useStunTurn: true and turn off the bridge's own TCP fallback with org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true in sip-communicator.properties (newer JVB versions expose the same switch in jvb.conf, so check the reference config for your version). The bridge then speaks UDP only. A participant who can't reach it over UDP connects to Coturn over TCP, and Coturn relays their media to the bridge over UDP.
Testing the TURN server
Don't test by joining a call and hoping. Open the WebRTC project's Trickle ICE page, add your turn:coturn.meetrix.io:443?transport=tcp URI with a username and credential generated from your secret, and gather candidates. A candidate of type relay means Coturn works. If you only get host and srflx, check the firewall and the Coturn log at /var/log/turnserver.log first.
If calls are still failing to connect after TURN is configured correctly, the problem is more often between Jicofo and the bridge than the TURN relay itself. Our Jicofo configuration troubleshooting guide covers that separately.
Special thanks : Damian Minkov of Jitsi Team.
Frequently Asked Questions
Why does Jitsi Meet need a TURN server?
Some corporate and institutional firewalls block the UDP ports Jitsi Meet normally uses for media. A TURN server gets around that by relaying media over a port that's much harder to block, usually 443, so people behind locked-down networks can still join.
What is the difference between STUN and TURN in this setup?
STUN just helps two peers figure out their public IP and port so they can try connecting directly. TURN goes further: when that direct connection is not possible, it relays the actual media between them. It costs more bandwidth, but it works on almost any network.
Why use Time-Limited Credentials instead of a static username and password?
A static username and password would have to live in client-side code, which means anyone could pull it out and reuse it. Time-Limited Credentials get generated on the fly from a shared secret and expire automatically, so there's nothing permanent to steal.
Why run the TURN server on port 443 instead of the standard TURN port?
Port 443 is the HTTPS port, and it's almost never blocked. Running Coturn on 443 lets TURN traffic blend in with normal web traffic, which is exactly what you need when everything else is locked down.
What is the difference between using TURN for p2p calls and using it with the JVB?
In peer-to-peer calls, TURN is just a fallback for when two people can't connect directly. In JVB calls, useStunTurn plus DISABLE_TCP_HARVESTER forces the bridge onto UDP only, and the TURN server handles TCP relay for anyone whose network blocks UDP outright.
Want a TURN Server Running Behind Jitsi Meet in Minutes Instead?
Skip the manual setup and get a pre-configured Coturn AMI running behind your Jitsi Meet deployment in minutes.
Deploy Coturn from AWS Marketplace