Setting up a coturn TURN server for BigBlueButton

Users behind restrictive firewalls often cannot reach BigBlueButton media directly, so a TURN relay on its own host can carry their connections. This page covers the design choices, build sequence, security and limits to confirm before you deploy.

On this page

When users need a coturn TURN server for BigBlueButton

Users on corporate or school networks often cannot reach BigBlueButton directly, because the firewall blocks the media paths a browser normally uses to send audio and video to the server. A separate coturn TURN host relays those connections, so the blocked user talks to the relay and the relay forwards the traffic to BigBlueButton. The BigBlueButton install documentation recommends TURN for users behind restrictive firewalls, so the practical question is which of your users need it. Ask the network team which outbound ports and protocols the schools or offices allow, and test a join from one of those networks before you build anything. Plan the TURN host as its own machine with its own hostname and certificate, because the users who are blocked must be able to reach it.

BigBlueButton still needs its own ports open on the server. Users must reach TCP 80 and 443 for the web application and its secure connections, and UDP 16384 to 32768 for the media stream. TURN carries media for clients that cannot reach that UDP range, but it does not open the range on the BigBlueButton server, and it does not replace the HTTPS endpoint that users load the meeting page from. Check the ports from the server side and from outside the perimeter, because a rule on one firewall does not prove the path is open on the next. Confirm with your network team whether the firewall allows UDP at all for each user group, since some networks block UDP outright and no server-side setting changes that.

TURN is not a guarantee. Some networks inspect or block everything except web traffic, and the relay itself may be blocked, so test each user group once the host is live and do not assume it works. The TURN host also has to be reachable from the blocked networks on the ports you configure, and it must share a secret with the BigBlueButton servers it serves. Before rollout, record which networks you tested, which joins worked with audio and video, and which failed. Those results decide whether you need a different relay path, a network change from the customer's IT team, or a clear message to affected users.

Choosing the TURN host layout, ports and certificate

This table compares TURN host layouts, port choices and certificate arrangements for a coturn server used by BigBlueButton. Read each row as a decision: the option, when it fits, what it changes in certificates and firewall rules, and what it adds to operations. The main takeaway is that port 443 reaches users on strict networks but needs its own address or host, while one TURN server per BigBlueButton server multiplies certificates and secrets to manage.

OptionWhen it fitsCertificate and firewall changesOperations impact
TURN on the BigBlueButton hostA single-server pilot or small deployment with one public addressShares the BigBlueButton hostname and certificate; TURN ports open on that same addressOne machine to patch, but relay traffic shares CPU and bandwidth with media
Separate TURN hostMedia load is high, or TURN must be patched and restarted without touching BigBlueButtonOwn FQDN and certificate; firewall allows TURN ports to the new host; shared secret must matchAnother host to monitor, patch and renew certificates for; secret changes touch both sides
Port 3478Networks that allow standard TURN traffic; the first listener to testOpen 3478 on the TURN host; confirm with the coturn documentation whether the listener uses TLSSimplest listener to test, but users on locked-down networks may still fail to connect
Port 443 (TLS)Users on strict corporate or school networks that allow only web trafficCertificate must match the hostname clients use; open 443 on the TURN host's addressPort 443 conflicts with any web server on the same address; plan a dedicated address or host
One shared TURN serverFew BigBlueButton servers in one location with one relay pool to manageOne certificate and FQDN referenced by every BigBlueButton server; firewall rules set onceSingle point of failure; relay load from all servers lands on one host; one secret rotation affects all
One TURN server per BigBlueButton serverServers need isolation, separate regions or separate tenantsOne FQDN, certificate and firewall pairing for each server; a DNS record per hostFailures stay contained, but more hosts, certificates and secrets increase drift over time
Sizing and verificationAny layout, before go-liveCertificate and port checks from outside the network, plus TURN relay tests from a strict networkConfirm TURN host sizing with the coturn documentation and your own tests before relying on it

Clients reach BigBlueButton through TURN or direct HTTPS

The diagram starts with a user's browser, which reaches the TURN host on port 3478 or 443 when its network blocks direct media. The TURN host sits in its own trust boundary with its own FQDN and certificate, and it relays media to the BigBlueButton server. The browser also opens a direct HTTPS connection on port 443 to BigBlueButton, which is a separate path from the TURN route. Before you test, check that both the TURN host and the BigBlueButton server hold the same shared secret in turn-stun-servers.xml.

Client traffic reaches the TURN host and BigBlueButton over separate paths.

How to set up a coturn TURN server for BigBlueButton

This sequence builds a TURN host that relays media for users whose networks block direct connections, then points BigBlueButton servers at it and proves that a restricted client can join. Each step ends with a check, so a failure traces to one layer at a time. Confirm exact coturn and BigBlueButton 4.0 configuration keys against the vendor documentation for your versions before you apply any example.

  1. Create the TURN host and DNS record

    Provision a host separate from the BigBlueButton servers, with its own public address and a fully qualified domain name such as turn.example.org (illustrative). The DNS team creates an A record for that name, plus AAAA records only if you plan dual-stack operation. Keep other web services off this host so that port 443 is free for coturn. Check: from a machine outside your network, resolve the name with dig or nslookup and confirm it returns the public address you expect.

  2. Obtain and install the TURN certificate

    Request a certificate for the TURN FQDN from your certificate authority or through Let's Encrypt, then install the full chain and private key where coturn can read them. The certificate must match the TURN name exactly, because clients validate it when they connect over TLS on port 443. Restrict the private key to root and the coturn service account. Check: run openssl x509 to confirm the subject, SAN and expiry date, and openssl verify against your CA bundle to confirm the chain is complete.

  3. Open ports 3478 and 443

    Allow TCP and UDP 3478 for TURN and TCP 443 for TLS-based TURN on the host firewall, any cloud security group, and any perimeter firewall in front of it. Coturn also needs a UDP relay port range for media, which the vendor documentation describes and which you must allow as well. Confirm that no other service already holds port 443 on this host. Check: list listeners with ss -tulpn on the host, then test reachability from outside your network with a port scanner or nc. A UDP result can be inconclusive, so the test call in the final step is the definitive check.

  4. Install and configure coturn

    Install coturn from your distribution's package or the project's supported release, then set the listening ports, TLS certificate and key paths, the realm and the relay settings in its configuration file. Enable the TLS listener on 443, use the TURN FQDN as the realm, and set the external IP if the host sits behind NAT. Verify each key name against the vendor documentation for your coturn version before you apply it. Check: restart the service, confirm it started cleanly in the journal, and confirm with ss that coturn listens on 3478 and 443.

  5. Set the shared TURN secret

    Generate a long random value and place it in coturn's static authentication secret setting, so coturn validates the time-limited credentials that BigBlueButton derives from it. Use the same secret on every BigBlueButton server that will point at this host. Store it in a file with restricted permissions, and never place it in a web page or client-side config. Record where each copy lives so that rotation can be planned across all servers. Check: confirm the file permissions are restricted, and compare a hash of each copy to confirm they match without printing the secret into logs.

  6. Point BigBlueButton at the TURN host

    On each BigBlueButton server, edit turn-stun-servers.xml so the TURN entry uses the TURN FQDN, port 443 over TLS, and the shared secret. Keep any STUN entries you need, and confirm the exact element and attribute names for your BigBlueButton 4.0 install before you save the file. Make the change on every server that shares this TURN host. Check: run an XML linter on the file to confirm it parses, and confirm the change is in place on each server before you restart anything in the next step.

  7. Test from a network that blocks media

    Restart coturn and the BigBlueButton services as the vendor documentation describes, then join a meeting from a network that blocks direct UDP media, such as a guest network with strict egress rules (illustrative). Confirm that audio, video and screen sharing work, and compare with a second client on an open network. Check: coturn logs should show allocation requests from the restricted client's address, and the session should stay connected for the full test. Keep a written record of firewall rules so later changes can be traced.

One coturn TURN server for several BigBlueButton servers

One coturn host can serve several BigBlueButton servers when each server's turn-stun-servers.xml names the same TURN FQDN and the same shared secret. The relay then accepts credentials issued by any of them, so the team builds, patches, monitors and renews the certificate on a single TURN host for the whole group. The cost of that simplicity is load concentration. Every relayed media stream from every connected server crosses the same host and the same network link, so size the host for the combined peak of the servers it serves, not for one server. Test that peak with a load run that covers those servers at the same time, and confirm that your bandwidth agreement covers the traffic the relay will carry.

The trade-off is simplicity against a single point of failure that reaches every server it serves. If the TURN host stops answering, users behind restrictive firewalls lose the relay path on all of those servers at once, while users with direct connectivity may still join. Monitor the TURN host on its own schedule, with a check that opens a relayed session from outside your network, and treat an outage there as an incident for the whole group. For critical events, decide in advance whether a second TURN host with its own FQDN is worth the added setup. Secret rotation is also shared: one secret touches every server, so plan it as a coordinated change to the TURN host and each BigBlueButton server in one window, and confirm the restart order for your release before you begin.

The part to confirm before you commit is how your BigBlueButton release selects and uses TURN candidates, especially when Scalelite sits in front of several servers. Scalelite makes the pool appear as one server and sends each meeting to the least loaded backend, so a user's relay load depends on where Scalelite placed the meeting, not on which server the user first reached. Check the BigBlueButton install docs for your release, then test the setup: join from a network that blocks direct media, once through each backend, and record which TURN host the client receives and whether it is reachable. Also confirm whether any external IP or TURN setting on individual servers changes what each one advertises to clients. Keep the results in the runbook, because a later change to the pool can change which TURN host clients use.

Securing the TURN host and its shared secret

The TURN host sits on the public internet and holds the secret that lets your BigBlueButton servers request relay access, so it needs the same care as any internet-facing service. The six cards below cover the credential, the certificate, exposed ports, administrative access, patching and logging. Work through them in order and record the result of each check in your deployment notes.

Treat the shared secret as a credential

The secret in turn-stun-servers.xml is what lets your BigBlueButton servers obtain relay credentials from the TURN host, so anyone who reads it can use your relay. Keep it out of web pages, client-side scripts, screenshots, support tickets and public repositories, and restrict read access to the configuration file on every server. The BigBlueButton API docs make the same point about their own shared secret. Verify that every BigBlueButton server holds the same value as the TURN host, and rotate the secret on all servers at once after staff changes or any suspected exposure.

BigBlueButton API docs

Renew the TURN certificate

The TURN host has its own FQDN and certificate, and clients rely on that certificate when relaying, including on port 443. When it expires, users behind restrictive firewalls cannot join, and the failure looks like a network problem rather than a certificate problem. Confirm that renewal runs automatically, that the renewed files are copied to the paths coturn reads, and that coturn reloads after each renewal. Verify by checking the expiry date on the live endpoint and on disk after a renewal test.

Limit exposed relay ports

A TURN host should answer only on the listening ports clients use, which for this setup are 3478 and 443, plus the relay range coturn allocates from. Every other open port is attack surface you do not need on this host. Run an external port scan from outside your network and confirm that only the expected ports respond. Then check that the relay range in your coturn configuration matches the range your firewall allows, and ask whether a cloud security group in front of the host applies rules of its own.

Restrict administrative access

SSH and any other management path on the TURN host should be reachable only from administrator networks or a bastion host. Key-based login should be the only accepted method, and direct root login should be disabled. TURN hosts often receive less attention than the BigBlueButton servers, which makes an open management port on them an easy route in. Verify the SSH listener with an external scan, confirm that password authentication is off, and review which accounts can read the file that holds the shared secret.

Patch coturn and the operating system

coturn and the base operating system both receive security fixes, and a TURN host that is installed once and then forgotten becomes a known-vulnerable service. Decide who applies updates, how often, and how a coturn restart is scheduled so it does not interrupt live meetings. Confirm the installed coturn version against your distribution's security status, check that automatic security updates or a fixed patch window is in place, and confirm the OS release is still supported. BigBlueButton 4.0 installs on Ubuntu 24.04, so check whether your TURN host runs the same release.

Install docs

Log and monitor relay use

Relay logs show which BigBlueButton servers authenticate, how many allocations are open, and whether traffic patterns look unusual. Without them, a leaked secret or a misconfigured server can carry traffic for a long time before anyone notices. Decide what to log, where the logs go, and how long they are kept, because relay logs can contain client IP addresses that your privacy policy covers. Verify that failed or unexpected authentication raises an alert, and that you can trace a relay session to a time window during an incident.

What a coturn TURN setup costs and what it needs from your team

What drives the cost of a coturn TURN setup for BigBlueButton?

The cost follows how much the TURN server must serve and how restrictive the networks around it are. The main drivers are the number of BigBlueButton servers that will use the TURN host, the firewall and network restrictions your users face (which decide whether TCP on port 443 is needed alongside port 3478), certificate management for the TURN name, and the monitoring you expect after go-live. Each driver adds design, configuration and testing work. Split the quote into one-time build work and recurring work such as certificate renewal, upgrades and retesting. Ask for each driver as its own line, with the hosts, networks and certificates the quote assumes.

How long does it take to set up a TURN server for BigBlueButton?

Duration depends on scope, and no fixed figure fits every environment. The build covers a separate TURN host, its own FQDN and certificate, firewall rules for ports 3478 and 443, the shared secret in turn-stun-servers.xml, and tests from networks that resemble your users' restricted networks. Time grows when DNS changes, certificate issuance or firewall approvals sit with other teams, because those steps depend on their schedules. Ask for a timeline in the written scope that marks which steps depend on your change windows and which depend on the delivery team. Confirm with your network team how long a firewall change takes before you plan go-live.

What does our team need to provide for a TURN server?

Your team typically provides the hosts, the DNS records, the certificate path and the network changes, along with test networks that show how users behind restrictive firewalls actually connect. In practice this means a host for coturn that is separate from the BigBlueButton servers, a DNS name that resolves to it, a TLS certificate for that name, and firewall rules that allow the TURN ports from your users and from the BigBlueButton servers. Ask your network team which firewalls sit between users and the TURN host, and whether you can test from a restricted guest network. Confirm the full list in the written scope before work starts.

Can an in-house team set up coturn for BigBlueButton alone?

Often yes, if the team already runs Linux servers, TLS certificates and firewall changes, and has time to test from restricted networks. The BigBlueButton install documentation covers the base install, but the steps that cause delay are usually outside the server, such as DNS changes, certificate renewal and firewall approvals. Teams that have never run BigBlueButton behind a restrictive network may want a second review of the design. Settle these questions first: who owns the TURN host after handover, who renews its certificate, who responds when a firewall rule changes, and who retests after a BigBlueButton upgrade. If the answers are clear, an internal build is a reasonable choice. A partner can also deliver the build as a fixed-scope project with documentation your team keeps.

Does one TURN server serve several BigBlueButton servers?

Yes, one TURN server can serve several BigBlueButton servers, and this is a common shared layout. Each BigBlueButton server is configured to use the same TURN host and the same shared secret in turn-stun-servers.xml, so the TURN server becomes a shared dependency. That role changes the cost: more BigBlueButton servers mean more clients relaying through one host, more bandwidth to plan, and a single point that must stay up during class hours. Confirm the sizing of the TURN host against your expected concurrent users. Also ask whether the design includes a second TURN host for failover, and how a change to the shared secret reaches every BigBlueButton server.

How do certificates and DNS affect a TURN server setup?

The TURN server needs its own fully qualified domain name and a valid certificate for that name, separate from the BigBlueButton hostname. Clients reach the TURN server by name, so DNS records must resolve before testing starts, and a certificate error on that name breaks the fallback path for users behind strict firewalls. Certificate management is recurring work: someone must own renewal, deployment to the TURN host and the reload step afterward. Ask who issues the certificate, how renewal is automated or scheduled, and how a failed renewal gets detected. Your security team should also confirm where the private key is stored and who can read it.

What ongoing work does a TURN server need after go-live?

Ongoing work covers certificate renewal, monitoring, updates to coturn and the operating system, and retesting after BigBlueButton upgrades. Each of these recurs for as long as the server runs, so ask for them as separate lines in any quote. Monitoring should show whether the TURN service is up, whether certificates are close to expiry, and whether connections succeed from restricted networks. Firewall rules and DNS records also need review whenever your network changes. Ask whether a retainer covers patching, testing and incident response, and what response expectations are written into it. DeployOpen offers ongoing support, upgrades and continuous testing as retainers.

What should a written scope for a TURN setup include?

A written scope should list the TURN host, the BigBlueButton servers that will use it, the DNS names, the certificate method, the firewall changes, the test networks and the deliverables. It should also state who performs each step, what the client must provide and by when, and how acceptance testing is done. Ask for the assumptions behind the quote, such as the number of BigBlueButton servers and whether recordings or Greenlight are in scope. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and provides a quote from that written scope. Use the written scope to compare the options, including an internal build.

Limits to confirm in your environment before you deploy

These five checks decide whether the TURN host you build will carry meetings for users behind restrictive firewalls. Each card names one assumption to test, the person or document that can confirm it, and the setting it affects. Work through them in order, since the install path and the default media server determine how the TURN settings are applied.

TURN host sizing for relayed media

Relayed audio and video pass through the TURN host, so relayed traffic counts against its bandwidth and CPU and grows with the number of users who cannot connect directly. The install docs list 250 Mbit/s symmetrical bandwidth for a BigBlueButton server, which describes that server only, so the TURN host needs its own estimate. Ask your network team for the symmetrical capacity of the TURN host's link and any limits on its firewall, then confirm per-session relay load with the coturn documentation before you choose an instance size.

Default media server TURN candidates

BigBlueButton 4.0 runs LiveKit as its default media server. Confirm with the install docs and your own test how that server selects and advertises TURN candidates, and whether your TURN host's address appears among them. Then run a test session from a network that blocks direct UDP. A TURN host that passes a simple connectivity check can still leave strict-firewall users without media if the candidates are wrong.

Dual-stack IPv4 and IPv6 records

If users reach BigBlueButton over IPv6, the TURN hostname may need both AAAA and A records, and coturn must listen on each address family you publish. Confirm that the TURN host has routable IPv6 and that every firewall rule covers it. Ask your DNS team whether the same FQDN publishes both record types, and ask your network team which ports are open on each family. Complete this check before you publish records to clients.

External TURN support by install path

The bbb-install.sh script installs BigBlueButton 4.0 on Ubuntu 24.04 64-bit, and the install path you choose decides whether an external TURN server can be wired in during setup. Confirm external TURN support for your exact install options in the install docs, including the option names and any post-install step. If the docs leave a question open, ask the BigBlueButton maintainers or your support contract before you build the host. Keep the install command and version in your change record so the setup can be repeated.

Install docs

Exact coturn version and keys

coturn options change between releases, so the version and the configuration keys must be set together. Record the coturn package version your TURN host runs, then check each key in your configuration against the coturn documentation for that release. Pin the version and the configuration keys in one change record. Ask your security team to review how the shared secret is stored and how TLS is configured, and confirm the matching turn-stun-servers.xml values in the BigBlueButton install docs for your release.

How DeployOpen scopes and delivers a TURN server rollout

DeployOpen treats the TURN server as its own piece of infrastructure, scoped alongside the BigBlueButton servers it serves. The work is agreed in writing before build starts, covering the host, certificate, ports, shared secret and the BigBlueButton servers that will use it. Delivery ends with documentation and checks your team can repeat, with ongoing support available as a retainer.

How we scope

  • The written scope names the TURN host, its fully qualified domain name and the certificate it will serve.
  • It lists which BigBlueButton servers will share the TURN server and which firewall ports must open.
  • Fixed-scope engagements are agreed in writing before work starts, and ongoing support is available as a retainer.

How we build

  • Provision a separate host with its own FQDN, then issue and install the certificate for that name.
  • Open TCP 3478 and 443 for TURN, and set the shared secret in turn-stun-servers.xml on each BigBlueButton server.
  • Test relay from a network that blocks UDP so the fallback path is proven before users depend on it.

How we hand over

  • Written configuration record covering host settings, certificate renewal, the secret's location and every BigBlueButton server using it.
  • Test evidence showing a client joining a meeting through the TURN relay, with the results logged.
  • Runbook steps for rotating the shared secret and renewing the TURN certificate on each server.

How we support

  • Retainers can cover upgrades, continuous testing and changes when you add BigBlueButton servers.
  • Confirm with your team who answers when a certificate nears expiry or relay logs show failed allocations.
  • Ask whether support covers the TURN host alone or the BigBlueButton servers that depend on it.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.