How To Install coturn on Ubuntu 20.04

In this tutorial we learn how to install coturn on Ubuntu 20.04. coturn is TURN and STUN server for VoIP TURN and STUN server for VoIP

Introduction

In this tutorial we learn how to install coturn on Ubuntu 20.04.

What is coturn

coturn is:

STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) are protocols that can be used to provide NAT traversal for VoIP and WebRTC. This package provides a VoIP media traffic NAT traversal server and gateway.

Supported RFCs: TURN specs:

STUN specs:

  • RFC 3489 - obsolete “classic” STUN specs;
  • RFC 5389 - base “new” STUN specs;
  • RFC 5769 - test vectors for STUN protocol testing;
  • RFC 5780 - NAT behavior discovery support.

The implementation fully supports UDP, TCP, TLS, and DTLS as protocols between the TURN client and the TURN server. Both UDP and TCP relaying are supported.

SQLite, MySQL, PostgreSQL and Redis are supported for the user repository (if authentication is required). The long-term credentials mechanism is supported. For WebRTC applications, the TURN server REST API for time-limited secret-based authentication is implemented. The third-party authentication specs (OAuth-based) are supported, too.

Load balancing can be implemented either by DNS round-robin mechanism, or with the external networking tools, or by the built-in ALTERNATE-SERVER mechanism.

The implementation is intended to be simple to install and configure. The project focuses on performance, scalability, and simplicity. The aim is to provide an enterprise-grade TURN solution.

Package: coturn Architecture: amd64 Version: 4.5.1.1-1.1build2 Priority: extra Section: universe/net Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian VoIP Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1422 Provides: stun-server, turn-server Depends: adduser, sqlite3, lsb-base (>= 3.0-6), telnet | telnet-client, libc6 (>= 2.17), libevent-core-2.1-7 (>= 2.1.8-stable), libevent-extra-2.1-7 (>= 2.1.8-stable), libevent-openssl-2.1-7 (>= 2.1.8-stable), libevent-pthreads-2.1-7 (>= 2.1.8-stable), libhiredis0.14 (>= 0.14.0), libmysqlclient21 (>= 8.0.11), libpq5 (>= 8.4~), libsqlite3-0 (>= 3.6.0), libssl1.1 (>= 1.1.0) Suggests: sip-router, xmpp-server Conflicts: rfc5766-turn-server, turnserver Filename: pool/universe/c/coturn/coturn_4.5.1.1-1.1build2_amd64.deb Size: 345008 MD5sum: 82782df87f95c5e605f5a50ea7197539 SHA1: 671fce2590e3c3b22d28347a2e355a111439c178 SHA256: b8116027a600384e092750c1597b96e7f45bb15bf41e187ab35e5c779f3149cf Homepage: https://github.com/coturn/coturn/ Description-en: TURN and STUN server for VoIP STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) are protocols that can be used to provide NAT traversal for VoIP and WebRTC. This package provides a VoIP media traffic NAT traversal server and gateway.

Supported RFCs: TURN specs:

STUN specs:

  • RFC 3489 - obsolete “classic” STUN specs;
  • RFC 5389 - base “new” STUN specs;
  • RFC 5769 - test vectors for STUN protocol testing;
  • RFC 5780 - NAT behavior discovery support.

The implementation fully supports UDP, TCP, TLS, and DTLS as protocols between the TURN client and the TURN server. Both UDP and TCP relaying are supported.

SQLite, MySQL, PostgreSQL and Redis are supported for the user repository (if authentication is required). The long-term credentials mechanism is supported. For WebRTC applications, the TURN server REST API for time-limited secret-based authentication is implemented. The third-party authentication specs (OAuth-based) are supported, too.

Load balancing can be implemented either by DNS round-robin mechanism, or with the external networking tools, or by the built-in ALTERNATE-SERVER mechanism.

The implementation is intended to be simple to install and configure. The project focuses on performance, scalability, and simplicity. The aim is to provide an enterprise-grade TURN solution.

There are three methods to install coturn on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install coturn Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install coturn using apt-get by running the following command:

sudo apt-get -y install coturn

Install coturn Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install coturn using apt by running the following command:

sudo apt -y install coturn

Install coturn Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install coturn using aptitude by running the following command:

sudo aptitude -y install coturn

How To Uninstall coturn on Ubuntu 20.04

To uninstall only the coturn package we can use the following command:

sudo apt-get remove coturn

Uninstall coturn And Its Dependencies

To uninstall coturn and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove coturn

Remove coturn Configurations and Data

To remove coturn configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge coturn

Remove coturn configuration, data, and all of its dependencies

We can use the following command to remove coturn configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge coturn

References

Summary

In this tutorial we learn how to install coturn package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.