HowTo: Setup Nextcloud Talk with TURN server

Bonjour,
Thanks for this how-to. Everything went well installing the coturn server (on Debian 10)
And here are the status :

● coturn.service - coTURN STUN/TURN Server
   Loaded: loaded (/lib/systemd/system/coturn.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-12-04 10:57:09 UTC; 24min ago
     Docs: man:coturn(1)
           man:turnadmin(1)
           man:turnserver(1)
  Process: 25469 ExecStart=/usr/bin/turnserver --daemon -c /etc/turnserver.conf --pidfile /run/turnserver/turnserv
  Process: 25471 ExecStartPost=/bin/sleep 2 (code=exited, status=0/SUCCESS)
 Main PID: 25470 (turnserver)
    Tasks: 9 (limit: 4915)
   Memory: 5.5M
   CGroup: /system.slice/coturn.service
           └─25470 /usr/bin/turnserver --daemon -c /etc/turnserver.conf --pidfile /run/turnserver/turnserver.pid
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: IO method (general relay thread): epoll (with changelist)
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: turn server id=2 created
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: IO method (general relay thread): epoll (with changelist)
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: turn server id=3 created
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: Total General servers: 4
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: IO method (auth thread): epoll (with changelist)
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: IO method (auth thread): epoll (with changelist)
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: IO method (admin thread): epoll (with changelist)
Dec 04 10:57:07 mydomain.tld turnserver[25470]: 0: SQLite DB connection success: /var/lib/turn/turndb
Dec 04 10:57:09 mydomain.tld systemd[1]: Started coTURN STUN/TURN Server. 

But when I add the TURN server URL, with the port on 3478 or 5349 + the secret phrase in the Nextcloud admin page I got a “no working ice candidates returned by the turn server” error.

My Nextcloud is 19.0.3.

Tks for your ideas.

2 Likes

Was just reading a German thread and apparently if you change the browser and test it with Chrome instead of, like in my case, Safari, the test will be succesful. Don’t ask me what the heck can be wrong about Safari, but I tried this and it’s actually true.

1 Like

follow step by step but get error when testing server
“Error: No working ICE candidates returned by the TURN server”

Double-check your authentication secret: Talk / Turnserver self test - #2 by anon93002831
Otherwise check you coturn logs.

EDIT: Just read the posts above yours: Some browsers seem to show a wrong result. Not sure why the browser should be involved at all, but if you don’t see any errors in the coturn logs, try it with a different browser.

If this is with the very last NC21/Talk11, it is likely meaningless

1 Like

The latest (minor) update Talk 11.2.2 fixes the error message: it now properly qualifies valid TURN servers (coTURN in my case)…

2 Likes

This would be great. Until now i have only found https://www.reddit.com/r/NextCloud/comments/fxowmg/looking_for_docker_stack_with_nextcloudturnstun/ and it is really insufficiently documented.

If anyone who is reading this and does not want to run their own TURN server, they can use one from https://openrelayproject.org.

It is completely free, and there is no security risk when using a 3rd party TURN server as WebRTC traffic going through the TURN server is already encrypted using DTLS+SRTP

looks interesting, but could not find the “secret” used for the TURN server.
only username and password is provided by the project. So I used the password as the turn secret, which did not work for me.
So if you have a working setup, could you post the information.

Thanks

Please follow the instructions here: Free WebRTC TURN Server - Open Relay Project | Open Relay Project - Free WebRTC TURN Server
Basically NextCloud uses shared secret auth instead of username/password authentication, so for that to work you have to use staticauth.openrelay.metered.ca as the TURN Server URL.

3 Likes

Thanks worked