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.
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