Skip to content

Instantly share code, notes, and snippets.

@ShivKumarSaini
Last active December 21, 2020 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivKumarSaini/dad91493ffd362b3ad4d0abc520f88f3 to your computer and use it in GitHub Desktop.
Save ShivKumarSaini/dad91493ffd362b3ad4d0abc520f88f3 to your computer and use it in GitHub Desktop.
Coturn installation steps

Third-party libraries

If you are installing the coturn package in Debian, Ubuntu or Mint, or if you installing the "turnserver" port in FreeBSD, or if you are installing one of the supplied binaries in the "downloads" section of the project, then the OS and the third party packages are installed automatically. The instrudctions below are for those who are setting the TURN server from scratch.

Before installing and configuring the TURN server, the latest stable libevent library should be downloaded, built and installed:

$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

As root, build and install the library with the usual:

$ tar xvfz libevent-2.0.21-stable.tar.gz

$ cd libevent-2.0.21-stable

$ ./configure

$ make

$ make install

Default setup assumes that you are using sqlite as the database engine, that is sufficient for most purposes. If your project requires a different database (mysql, postgresql, mongodb, redis) then check the INSTALL file for the instructions.

You will need, also, a relatively fresh OpenSSL version.

Steps to install and configure Coturn

Install Coturn

sudo apt-get -y update
sudo apt-get -y install coturn

Configure Coturn to start at startup

sudo nano /etc/default/coturn

TURNSERVER_ENABLED=1

Open the config file and uncomment the options with the given params

sudo nano /etc/turnserver.conf

listening-ip=// Public IP address of the instance // can be skipped if <external-ip> is set
realm=<my super secret realm>
fingerprint
external-ip=<your public IP>
listening-port=<port opened in firewall e.g. 3478>
min-port=10000
max-port=20000
log-file=/var/log/turnserver.log
verbose
user=<username>:<plain text password>

Stop and start coturn service

sudo systemctl stop coturn
sudo systemctl start coturn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment