coturn/coturn logo

coturn/coturn

Free

coturn TURN server project

FreeFree tier
Type
Open Source

About coturn/coturn

Coturn is a free and open-source implementation of TURN and STUN Server, designed to serve as a VoIP media traffic NAT traversal server and gateway. It supports a wide range of standards including STUN (RFC 3489, 5389, 5769, 5780, 7443, 7635) and TURN (RFC 5766, 6062, 6156, 7443, 7635, 8016), along with DTLS, REST API, multi-tenant support via Origin field, and ICE specifications. It can be deployed via Docker, Linux package managers, or built from source, and offers integration with multiple backend databases (SQLite, PostgreSQL, MySQL, Redis) and TLS/DTLS encryption. The project is widely used in WebRTC and real-time communication systems, with over 14k stars on GitHub and a large community.

Key Features

STUN support (RFC 3489, 5389, 5769, 5780, 7443, 7635)
TURN support (RFC 5766, 6062, 6156, 7443, 7635, 8016)
DTLS 1.0 and 1.2 support
TURN REST API for authorization (RFC 7635)
Multi-tenant TURN Server via Origin field
Client-to-server protocols: UDP, TCP, TLS, DTLS, SCTP (experimental)
ICE specifications (RFC 5245, 5768, 6336, 6544, 5928)
Database backends: SQLite, PostgreSQL, MySQL/MariaDB, Redis
Docker container support (published on Docker Hub, GitHub Container Registry, Quay.io)
Easy installation on Linux via apt or similar package managers

Pros & Cons

Pros
  • Completely free and open source
  • Comprehensive RFC compliance covering STUN, TURN, ICE, and DTLS
  • Supports multiple transport protocols: UDP, TCP, TLS, DTLS, SCTP
  • Available via Docker containers for easy deployment
  • Integrates with various databases for user authentication and monitoring
  • Active community with 14.2k GitHub stars and 2.3k forks
  • Extensive documentation including man pages and examples
Cons
  • Configuration can be complex due to many options and parameters
  • Lacks a built-in web-based graphical user interface
  • Requires external dependencies (e.g., libevent2, libmicrohttpd) for building
  • SCTP support is experimental and may be unstable
  • No official mobile SDK or client libraries provided

Best For

VoIP media traffic NAT traversal and relayWebRTC applications requiring TURN/STUN for peer-to-peer connectionsReal-time communication systems needing secure media relay (TLS/DTLS)General UDP/TCP NAT traversal for any applicationMulti-tenant TURN server deployments for service providers

FAQ

How do I install coturn on Linux?
On many Linux distributions, you can install coturn via the package manager, e.g., 'apt install coturn'. After installation, run 'turnserver --log-file stdout'.
Does coturn support Docker deployment?
Yes, coturn is available as a Docker image. You can run it using 'docker run -d -p 3478:3478 -p 3478:3478/udp -p 5349:5349 -p 5349:5349/udp -p 49152-65535:49152-65535/udp coturn/coturn'.
What protocols does coturn support for client-to-server communication?
Coturn supports UDP, TCP, TLS, DTLS (1.0 and 1.2), and SCTP (experimental) as client-to-server protocols.
Can coturn be used as a standalone STUN server?
Yes, coturn implements both STUN and TURN standards. It can act as a STUN server for NAT discovery (RFC 3489/5389) as well as a TURN relay.
How does coturn handle user authentication?
Coturn supports multiple user database backends including SQLite, PostgreSQL, MySQL/MariaDB, and Redis. It also implements the TURN REST API (RFC 7635) for third-party authorization and supports long-term credentials.