coturn implements STUN and TURN for relaying VoIP and WebRTC media through NATs. It runs as a user-space server on Linux, BSD, macOS, Windows, and in Docker.
Overview
coturn is a free open-source STUN and TURN server. In ICE-based VoIP and real-time setups it helps clients traverse NATs by allocating relay addresses and forwarding media when direct paths fail.
The server implements current STUN and TURN specifications, including dual-stack allocations and channel ranges used with WebRTC. Client protocols include UDP, TCP, TLS, and DTLS; SCTP relay is experimental. Authentication can use long-term credentials or an experimental OAuth-style option, with user records in SQLite, MariaDB, MySQL, PostgreSQL, Redis, or MongoDB.
Management is available through telnet CLI and HTTPS. Redis can store statistics and notifications. Load balancing can use DNS SRV, ALTERNATE-SERVER responses, or external network balancers. Bandwidth limits and congestion controls are built in.
On Linux, high UDP throughput uses recvmmsg, sendmmsg, and GSO where available; libevent2 handles I/O elsewhere. The process targets simple installation and operation on common server platforms and can also run from a Docker image.
Key features
- STUN and TURN protocol support
- TLS and DTLS for TURN
- Multiple user database backends
- Telnet and HTTPS management
- Redis status and statistics
- Load-balancing options
- Bandwidth limitation controls
- Docker container deployment
Use cases
- WebRTC media relay infrastructure
- VoIP connectivity behind strict NATs
- ICE deployments with custom credentials
- Scaled TURN pools behind load balancers