When Mattermost Calls users need a TURN server
A TURN relay is needed when some Mattermost Calls users cannot send media directly to the media service, even though the call signaling reaches the server. Calls work for most people on open networks, but users on restrictive corporate firewalls, some VPNs or networks that only allow outbound web traffic may connect to the call and then get no audio or video. A TURN server sits between the client and the media service and forwards the media packets, so the path still works when a direct UDP route is blocked. It does not replace the media service itself, and it adds a second network hop that consumes bandwidth and adds some latency on the server that relays the media.
Deciding on a relay is a separate choice from deploying the RTCD media service. RTCD handles the media processing for calls, while TURN only helps clients reach it. A relay can be unnecessary for an office with open egress, and it can be required for a remote workforce on hardened laptops. Start by checking the symptoms: calls that connect but show no media, failures that affect only specific networks or VPN profiles, and call-quality metrics that look normal on the server side. Then run a connectivity test from the affected networks, comparing a direct UDP path with a TCP or TLS path. Confirm the relay requirements, the ports to open, the supported TURN software and the required credential format in Mattermost's Calls documentation before you choose a product, because this material was not part of the research supplied for this page.
Write down the affected user groups, the networks they use and the outcome of each test before you change any firewall rules or deploy a relay. That record shows whether a TURN server solves the problem or whether the block is on a network you do not control, such as a third-party proxy. It also tells your security team which ports and destinations a relay will need, which is the input for the network design and firewall approvals described in the sibling topics on ports, STUN and TURN.
How RTCD, STUN and TURN fit together in a call path
A call starts in the browser or desktop client, which sends signaling through the Mattermost server running the Calls plugin. Media takes a separate path to the RTCD media service, and the client reaches it directly, through the optional STUN service for public address discovery, or through a TURN relay when a firewall or proxy blocks direct traffic. Check each boundary the media path crosses, because a relay only helps if the network lets its traffic through.
Signaling and media paths in a Mattermost Calls deployment, with trust boundaries.
Mattermost Calls TURN server options compared with STUN and direct media
This table compares the three ways Mattermost Calls clients can reach the media service: direct media, STUN-assisted address discovery and a TURN relay. Read each row against your client networks, since the right mix depends on which users sit behind restrictive firewalls or proxies. Confirm the exact ports and network requirements in Mattermost's current documentation before you commit to a design.
| Option | When it fits | What it needs from the network | What it exposes and adds to operations |
|---|---|---|---|
| Direct media | Clients on open networks that can reach the media service directly | UDP path from clients to the RTCD media service on the ports Mattermost documents; confirm the current list | Media flows between clients and your media host, so exposure is limited to the media service; no extra relay service to run |
| STUN for public address discovery | Clients behind NAT that need to learn their public address before connecting | Reachability to a STUN service; confirm whether your Mattermost version uses the built-in service or an external one | Reveals client public addresses to the STUN service; adds a lookup dependency to monitor, and air-gapped networks need a private alternative |
| TURN relay | Clients behind restrictive firewalls or proxies where direct and STUN paths fail | A reachable TURN host on the ports and protocols your client networks allow; confirm supported transports and credential method | All media for relayed clients passes through the TURN host, so it carries bandwidth, latency and security load; it needs its own sizing, certificates and monitoring |
| Mixed design (STUN plus TURN) | Organizations with a mix of open and restricted client networks | Both the STUN path and the TURN host reachable from the right networks, with firewall rules tested per segment | Most flexible, but the most components to configure, test and watch during upgrades |
Where to place a TURN server for Calls
In a cloud deployment, the TURN relay runs on a virtual machine that receives a public address, usually alongside the Mattermost server and RTCD in the same account or virtual network. Exposure is the main concern: the relay must accept inbound connections from client networks that may be outside your control, so the security group or network access list must be scoped to the ports the relay actually uses rather than opened broadly. Clients reach the relay directly over the public address, and the relay forwards media to RTCD over the private network, which keeps the media service itself off the internet. Plan the address so it stays stable across restarts, because client configuration and firewall rules at user sites depend on it.
- Public address ownership: confirm who requests, reserves and renews the public address and whether it is static.
- Security group scope: confirm that only the relay ports are reachable from the internet and that RTCD stays on private addresses.
- Private path to RTCD: confirm that the relay reaches RTCD over a private route that your cloud network policy allows.
- Cloud provider terms: confirm whether the provider restricts UDP or media traffic on your account tier.
Ask your cloud platform owner which account and network own the relay, and who approves changes to its security rules.",
On premises, the relay usually sits in a DMZ, a network segment between the internet firewall and the internal network. The DMZ placement limits how far an exposed service can reach into internal systems, while RTCD and the Mattermost server stay on the internal network. Clients outside the building reach the relay through a public address that the perimeter firewall translates, and the relay then talks to RTCD across the internal boundary. Each crossing needs an explicit rule, and NAT translations for UDP can behave differently from TCP, so the firewall team should test both protocols rather than assume one covers the other.
- Firewall rules per direction: confirm inbound rules from the internet to the relay and outbound rules from the relay to internal RTCD.
- NAT behavior for UDP: confirm that the perimeter device preserves the mappings the relay needs for media.
- Inspection and timeouts: confirm whether deep packet inspection or idle timeouts affect long-running call sessions.
- Internal reachability: confirm that the DMZ can reach RTCD without opening the internal network to other DMZ hosts.
Ask the network security team who approves the DMZ rule set, how changes are logged, and whether the firewall supports the protocol and port combinations you plan to use.",
When Mattermost and RTCD run on a Kubernetes cluster you operate, the TURN relay can run as a workload in the same cluster, exposed through a load balancer or node-level addressing. The placement question becomes how traffic enters the cluster and which network policies govern it. The relay must receive client traffic on the public side of the load balancer, and it must reach RTCD pods through cluster networking. Load balancer type, UDP support and the cloud or on-premises provider all affect what is possible, so confirm them before writing manifests. Network policies should limit the relay to the RTCD pods and the required external paths.
- Load balancer UDP support: confirm that the load balancer in your environment supports the UDP traffic the relay requires.
- Ingress path for media: confirm whether media enters through a service of type load balancer, host networking or another mechanism your platform approves.
- Network policy: confirm that policies allow relay to RTCD traffic and block unrelated pod access.
- Platform ownership: confirm which team manages cluster networking, load balancers and certificate or secret handling.
Ask your platform team whether the cluster already has a pattern for UDP services and who signs off on exposing a workload through its load balancer.
Setting up a TURN server for Calls in order
This sequence takes a TURN relay from an unproven need to a verified path, so Mattermost Calls keeps working for users whose networks block direct media. Each step ends with a check you can record before moving on.
Confirm the need with network tests
Before any server is built, run test calls from the networks where users actually struggle, including branch offices, guest Wi-Fi, VPN exits and any proxy-restricted segment. Record whether media connects directly, through the Mattermost STUN service, or fails entirely. Your network team owns this step, with DeployOpen or your own engineers capturing results from each location. It is done when you have a written list of affected networks and the connection type each one achieved. If every network connects directly, a TURN server is not needed yet.
Choose TURN software and placement
Select the TURN server software your team can operate and patch, and confirm it is supported in the Mattermost Calls documentation for the version you run. Decide where the relay sits: typically in a network zone that users on restricted networks can reach, with outbound paths to the RTCD media service. Involve the firewall and network owners early, because placement determines which ports and protocols you must open. It is done when the software, host location and reachability path are written down and approved.
Plan addressing and certificates
Document the public and private IP addresses, DNS names, the relay port range and the TLS certificate the relay will present, if TLS is used on the TURN listener. Check the certificate chain against the trust store on client devices, because a mismatch is a common cause of failed relays on managed endpoints. Agree the port ranges with the firewall team and confirm them against the Mattermost Calls network port documentation. It is done when the address plan and certificate source are reviewed and the firewall change request is filed.
Configure the relay and its credentials
Install and configure the TURN server with the realm, listening ports, relay port range and authentication model that match the Mattermost Calls settings. Create the shared secret or credential mechanism the Calls configuration expects, and store it in your secrets manager rather than in plain text configuration files. Take exact configuration keys, ports and defaults from Mattermost's Calls documentation at the time of the build, not from this page or from older examples. It is done when the relay starts cleanly, logs show it listening on the planned ports, and a basic allocation test succeeds from a host on the internal network.
Connect the relay to RTCD
Add the TURN server details to the Calls configuration and the RTCD media service so the media service hands out relay candidates to clients that need them. Confirm the RTCD service can reach the relay on the agreed ports and that the credentials match on both sides. Restart or reload services in the order the Mattermost documentation specifies. It is done when RTCD logs show the relay is registered and no authentication errors appear for relay allocations.
Test from a restricted client network
Place a test call from a network that blocks direct peer-to-peer media, such as a segment that only permits outbound HTTPS and the relay ports. Confirm the call connects, audio and video flow in both directions, and screen sharing works. Check the client's connection details to verify that media passed through the relay, and review TURN server logs for the test session. Repeat the test from each network identified in step one. It is done when every affected network completes a call with media verified and the results are recorded.
Record the baseline and hand over
Save the working configuration, firewall rules, credential rotation procedure and test results as the baseline for operations. Add relay health checks and call quality metrics to your monitoring plan, and assign owners for certificate renewal and credential rotation. Schedule a repeat test after each Mattermost server upgrade or RTCD change, since configuration references can move between versions. It is done when the operations team has the runbook, the monitoring is in place and the owner of each recurring task is named.
Securing the relay: credentials, exposure and logging
A TURN relay forwards media for users who cannot reach Calls directly, so it sits on the path of real call traffic and must be locked down like any internet-facing service. The cards below cover credentials, network reach, encryption, logs, patching and monitoring, and each one names a specific check to confirm before the relay goes live.
Issue short-lived relay credentials
Calls clients need credentials to allocate a relay, and those credentials should be time-limited rather than static shared passwords. Confirm with the Calls and TURN server documentation which credential mechanism the Mattermost server and your TURN software support together, then set a lifetime that covers a call without leaving a usable secret around for long. Document who rotates the shared secret, how often, and what happens to active calls when it changes.
Restrict which networks reach the relay
Decide which source networks may open allocations on the relay and block everything else at the firewall. A relay that accepts connections from the whole internet becomes an open traffic forwarder that attackers can abuse. Limit the relay's allowed peer address ranges where your TURN software supports it, and confirm that internal clients and the Mattermost server can still reach it on the ports you chose.
Confirm how media encryption works
Before you rely on the relay for privacy claims, read what the Calls documentation says about how media is encrypted. The relay forwards packets, so you need to confirm which layer protects the audio and video and whether the relay can read the content. Record the answer in your data handling notes so security reviewers do not have to infer it from the architecture.
Decide what the relay logs
TURN software can log allocations, errors and client addresses, which is useful for troubleshooting and sensitive for privacy. Set the log level deliberately, decide whether client IP addresses are retained, and name the destination for logs, such as a central log platform you already operate. Confirm the retention period with your privacy and compliance owners before enabling verbose logging.
Plan patching for the relay software
The relay is a network service that exposes a listening port to users, so its software needs a named owner and a patch cadence like the Mattermost server itself. Track security advisories for the TURN package you run, test updates on a staging relay that handles a sample call, and keep the rollback steps written down. Include the relay host operating system in the same routine.
Add the relay to firewall and monitoring plans
Record the relay's listening ports, relay port range and host addresses in your firewall change records and asset inventory, so the device is not an unknown exception during reviews. Add health checks and alerts for relay availability and allocation failures to your monitoring plan, and tell the team which dashboards show call quality problems. Confirm the port set against the Mattermost Calls network documentation before opening anything.
What a TURN relay changes in day-to-day operations
Once a TURN relay is in place, it sits in the media path for every call that falls back to it, so its health, capacity and credential state now affect call quality as much as the Calls plugin and RTCD do. Treat the relay as a monitored production service with its own owner, alerts and runbook. Confirm with your network team who owns the host, how TURN credentials are issued and rotated, and when the TLS certificate on the relay expires. A lapsed certificate or expired credential typically shows up to users as calls that connect but have no audio or video for some participants, which is easy to misread as a client problem. Record the expiry dates in your change calendar before go-live.
Watch the relay next to the Calls plugin and RTCD metrics rather than in a separate tool, so that a spike in relayed sessions can be compared with call setup failures and media quality on the same timeline. Ask the relay vendor or your network team which metrics the relay exposes for bandwidth, active allocations and rejected requests, and confirm that your scrape and alert setup can collect them. Capacity planning needs the same view: if relayed traffic grows over time, the relay host's bandwidth becomes the limit, and you should know that before users notice. The sibling topic on monitoring Mattermost Calls with Prometheus covers the scrape setup in detail.
Every Mattermost and RTCD upgrade needs a relay compatibility check before it reaches production. Confirm that the TURN server version, its TLS settings and its credential format still work with the Calls plugin and RTCD versions you plan to run, and test a call that is forced through the relay in staging. Plan the upgrade window so that the relay and the media services move together, and keep the previous relay build available for rollback. When an incident does happen on the relay, users usually see calls that fail only for people on restrictive networks while everyone else connects normally, so the first support question is which network path the affected users were on. Keep a runbook that tells the on-call engineer how to check relay status, certificates and recent credential issuance before they escalate to the Calls team.
Limits to confirm before you build a TURN server
A TURN relay sits between Mattermost Calls clients and the media service, so its design depends on facts about your plan, your software choices and your network. The cards below list the points to confirm with Mattermost, your TURN software vendor and your network team before you commit to an architecture.
Plan and version support
Confirm that your Mattermost plan and server version support the Calls configuration you intend to run, including the relay and media service pieces. Plan levels change which features are included, and the pricing page lists features by tier rather than by deployment pattern. Ask Mattermost to confirm the exact Calls and RTCD components that your plan covers, and record the answer in the design document alongside the server version you will run. Get this in writing before procurement.
Mattermost pricingTURN software compatibility
Ask Mattermost which TURN server software it supports with the Calls version you plan to run, and which configuration options it has tested. A relay that works in a lab can still fail against a specific release, so confirm the software version, the authentication method for relay credentials and the ports it needs. Do not assume that any standards-compliant TURN implementation will work without this confirmation.
Air-gapped and private addresses
Determine how the relay behaves when your deployment uses private addresses or has no internet access. Ask whether the relay must advertise a public address, whether private-address candidates work for your users, and whether the relay needs to reach external services during startup or operation. Mattermost documents separate guidance for air-gapped Calls, so confirm which pattern applies before you assign addresses.
Firewall and proxy vendor policy
Check with your firewall and proxy vendors whether they allow the UDP and TCP traffic the relay needs, including any deep packet inspection or protocol enforcement that may block media traffic. Some proxies only pass web traffic, so confirm whether they can carry the relay's protocol on the ports you choose. Ask your network team to test from a representative restricted network segment, not only from the office LAN.
Licensing for add-on services
Confirm whether any add-on service in the path, such as recording, transcription or a commercial TURN product, requires its own license or subscription. Ask whether license terms count users, hosts or concurrent sessions, and whether the terms change for relay traffic that passes through your own infrastructure. Record these terms with the rest of the scope so that renewal dates and seat counts are tracked separately from the core server subscription.
Bandwidth and capacity limits
Ask Mattermost which bandwidth, participant and capacity limits it documents for Calls media and for the relay you plan to run. Relayed media uses more bandwidth than direct media because every stream passes through a server you operate, so your uplink and the relay host's network capacity can become the limit. Confirm the documented figures for your Calls version and size your links and hosts from those figures, not from estimates made during design.
How much effort does a Mattermost Calls TURN server take?
What drives the effort and cost of a TURN relay for Mattermost Calls?
The biggest drivers are how many user networks need relay access, how much access review your network and security teams require, where the relay is placed, and how much testing happens from restricted networks. A TURN relay is one component among several in a Calls deployment, so its effort depends on how the surrounding network is already designed. Costs fall into one-time work (design, deployment, testing and documentation) and recurring work (monitoring, patching and changes when networks or firewall rules change). Your own infrastructure costs for compute, bandwidth and load balancing are separate from any services engagement. Ask any provider to itemize these components in a written scope before comparing quotes.
Can our internal team build a Mattermost Calls TURN server without a partner?
Yes, if your team has experience with network design, Linux server administration and firewall change management. The work involves deciding whether a relay is needed at all, placing it where media can reach it, configuring it alongside the RTCD media service and verifying calls from the networks your users actually use. Teams without recent experience in NAT traversal or media protocols often spend the most time on testing from restricted networks, not on installation. A partner is most useful when the deadline is fixed, the network review is complex or the team lacks someone who can own the design after go-live. Confirm your skills against the official Mattermost deployment documentation before deciding.
What does the TURN work need from our network and security teams?
Expect the network team to review firewall rules, public addressing, load balancer placement and which ports must be open between user networks, the Mattermost server and the media service. The security team typically reviews what traffic leaves and enters the perimeter, how credentials for the relay are issued and rotated, and how logs are retained. Both teams should agree on a change window and a rollback plan before any rule changes. Plan for these reviews to take place early, because approval cycles often set the schedule more than the technical build does.
How long does a TURN server project take to complete?
No duration can be stated for this work without a scope, because the timeline depends on the number of networks to test, the number of approvals required and whether placement changes are needed. A project that only adds a relay to an existing RTCD setup is shorter than one that also redesigns perimeter access. Ask any provider to break the schedule into design, approval, build, test and handover phases, with named dependencies on your review teams. Under a fixed-scope agreement, these phases and their deliverables should be written down before work starts.
What testing from restricted networks is needed before go-live?
Test calls from each class of network your users rely on, including corporate networks with firewalls or proxies, guest networks, and any mobile or remote access paths. Check that audio and screen sharing work in both directions and that calls recover when a network changes. Keep a record of which network types were tested and what failed, so the list can be repeated after changes. This testing is often underestimated because each restrictive network can behave differently, and fixes may require another review cycle.
What changes after go-live, and who maintains the relay?
After go-live, the relay needs ongoing monitoring, patching, credential rotation and retesting whenever Mattermost, RTCD or your firewall policies change. Mattermost publishes server releases monthly, and Extended Support Releases follow a longer cycle, so plan a recurring upgrade window that includes Calls testing. Assign a named owner for the relay, define what alerts go to whom and document the runbook. Ask any provider whether ongoing support is included in the initial scope or sold as a separate retainer, and what response expectations, if any, are written into it.
What should we ask for in a written quote for TURN server work?
Ask for a scope that lists the networks to be tested, the number of environments covered, the exact deliverables (design, configuration, runbook, test report) and what is excluded. Request a breakdown of one-time and recurring work, the assumptions about your infrastructure, and the responsibilities of your team, including reviews and approvals. Confirm who provides hardware, bandwidth and licenses, and whether retesting after changes is included. Compare quotes on the written scope, not on headline effort, because two offers with different exclusions are not comparable.
How DeployOpen scopes and delivers Calls network work
DeployOpen plans and builds the TURN relay around your network, your firewall rules and the RTCD media service, inside infrastructure you control. The written scope fixes what is delivered before any change is made to your environment.
How we scope
- Map which users sit behind restrictive firewalls or proxies and whether direct media paths fail today
- Agree in writing where the TURN server runs, which ports and protocols it uses, and how it reaches RTCD
- Confirm certificate, DNS and address plans, including public and private addresses for each network zone
- Set out engagements as fixed scope, with deliverables and timelines agreed in writing before work starts
How we build
- Deploy the TURN relay in the network zone you specify, with firewall rules limited to the agreed ports
- Configure its credentials and integration so Mattermost Calls and RTCD can use the relay
- Test calls from inside restrictive networks, outside networks and mobile connections, and record the results
- Document configuration, firewall changes and known limits so your team can review them against your security policy
How we hand over
- Provide runbooks for restarting the relay, rotating credentials and changing addresses
- Walk your network, security and platform engineers through the design and the test evidence
- List the monitoring points to watch for relay load, failed allocations and dropped media
- Confirm with your team which items remain their responsibility after the engagement closes
How we support
- Offer ongoing support, upgrades and retesting as a retainer when your Mattermost or network setup changes
- Plan retesting after each Mattermost server upgrade, since Calls components may need to move with it
- Ask for support terms, response expectations and upgrade handling in writing before you sign
- Keep documentation current with each change so audits and incident reviews have accurate records

