The configuration of Nextcloud Talk mainly depends on your desired usage:
Download/install
sudo apt install coturn
Make coturn run as daemon on startup
sudo sed -i '/TURNSERVER_ENABLED/c\TURNSERVER_ENABLED=1' /etc/default/coturn
/etc/default/coturn
but is enabled automatically after install. To check whether a systemd unit is available:
ls -l /lib/systemd/system/coturn.service
/path/to/turnserver -c /path/to/turnserver.conf -o
-o
starts the server in daemon mode, -c
defines the path to the config file.Configure turnserver.conf for usage with Nextcloud Talk
At last you need to adjust the TURN servers configuration file to work with Nextcloud Talk. On Debian and Ubuntu, it can be found at /etc/turnserver.conf
. The configuration depends on if you want to use TLS for secure connection or not. You may want to start without TLS for testing and then switch, if everything is working fine:
Without TLS uncomment/adjust the following settings. Choose the listening port, e.g. 3478
(default for non-TLS) or 5349
(default for TLS) and an authentication secret, where a random hex is recommended: openssl rand -hex 32
:
listening-port= fingerprint use-auth-secret static-auth-secret= realm=your.domain.org total-quota=100 bps-capacity=0 stale-nonce no-loopback-peers no-multicast-peers
With TLS you need to provide the path to your certificate and key files as well and it is highly recommended to adjust the cipher list:
tls-listening-port= fingerprint use-auth-secret static-auth-secret= realm=your.domain.org total-quota=100 bps-capacity=0 stale-nonce cert=/path/to/your/cert.pem pkey=/path/to/your/privkey.pem cipher-list="ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5" no-loopback-peers no-multicast-peers
Note that in case of TLS you only need to set tls-listening-port
, otherwise only listening-port
. Nextcloud Talk uses a single port only, thus the alternative ports offered by the settings file can be ignored.
I added a working cipher example here that is also used within most other guides. But it makes totally sense to use the cipher-list from your Nextcloud webserver to have the same compatibility versus security versus performance for both.
If you want it damn secure, you can also configure a custom Diffie-Hellman file and/or disable TLSv1.0 + TLSv1.1. But again, it does not make much sense for my impression to handle it different here than for Nextcloud itself. Just decide how much compatibility you need and security/performance you want and configure webserver + coturn the same:
dh-file=/path/to/your/dhparams.pem
no-tlsv1
no-tlsv1_1
listening-ip
and relay-ip
. On larger deployments it is recommended to run your TURN server on a dedicated machine that is directly accessible from the internet.The following settings can be used to adjust the logging behaviour. On SBCs with SDcards you may want to adjust this, as by default coturn logs veeery much :wink:. The config file explains everything very well:
no-stdout-log log-file=... syslog simple-log
sudo systemctl restart coturn
or corresponding restart method
Configure Nextcloud Talk to use your TURN server Go to Nextcloud admin panel > Talk settings. Btw. if you already have your own TURN server, you can and may want to use it as STUN server as well:
STUN servers: your.domain.org:
TURN server: your.domain.org:
TURN secret:
UDP and TCP
Do not add http(s)://
here, this causes errors, the protocol is simply a different one. Also turn:
or something as prefix is not needed. Just enter the bare domain:port
.
Port opening/forwarding\
The TURN server on <yourChosenPortNumber>
needs to be available for all Talk participants, so you need to open it to the web and if your TURN server is running behind a NAT, forward it to the related machine.
Nextcloud Talk is still based on the Spreed video calls app (just got renamed on last major update) and thus the Spreed.ME WebRTC solution. For this reason all guides about how to configure coturn for one of them, applies to all of them.
Futher reference
Thanks to @fancycode and @mario for some clarifications about all of this and if you don't mind, please review the HowTo for possible mistakes or wrong understandings. Thanks as well to @sushidave for motivating me to write this HowTo :slightly_smiling_face:.