How to setup Coturn (with Docker)
Untested
Description
coturn is a free open source implementation of TURN and STUN Server. The TURN Server is a VoIP media traffic NAT traversal server and gateway.
Files and Folders
Create the folder structure.
Config file
First, generate a strong secret:
Copy it to your clipboard!
Then, add this to turnserver.conf:
Docker
-
Add the
coturnsection to yourdocker-compose.ymlfile: -
Download and start the
coturndocker image:
Configuration
The only way to know if the service actually works as intended is to see if other services can use it successfully.
You'll need to configure your Audio/Video call service(s) to use your (co)turn service.
Port forwarding
First, you'll need to go to your router settings and forward port 3478 to the server where your coturn service is running.
Warning
Make sure it's for both TCP and UDP.
If it's just TCP, it won't work!
Matrix/Synapse
Add this to your homeserver.yaml configuration (probably in /home/dan/services/matrix/synapse/):
turn_uris:
- "turn:akdscloud.eu:3478?transport=udp"
- "turns:akdscloud.eu:3478?transport=tcp"
turn_shared_secret: "your_very_secret_key_here" # Use the same secret you set in turnserver.conf
turn_user_lifetime: 86400000
turn_allow_guests: true
Nextcloud Talk
Go to Nextcloud admin panel > Talk settings.
Add new TURN server
Check if it's running by clicking the pulse button on the right.
If the pulse button turns into a green checkmark, then everything is ok!
If the pulse button turns into a red warning icon, then the TURN server isn't running properly.
Add new STUN server
Jitsi Meet
Make sure you have these in your docker-compose.yml under jvb --> environment:
jvb:
environment:
- JVB_ADVERTISE_IPS=${JVB_ADVERTISE_IPS}
- JVB_STUN_SERVERS=akdscloud.eu:3478
prosody:
environment:
- STUN_HOST=akdscloud.eu
- STUN_PORT=3478
- TURN_CREDENTIALS=${TURN_CREDENTIALS}
- TURN_HOST=akdscloud.eu
- TURN_PORT=3478
- TURN_TRANSPORT=tcp,udp
Add/modify the following variables in the .env file:
TURN_CREDENTIALS=<put your TURN server's secret here>
JVB_ADVERTISE_IPS=<put you machine's public IP here> (e.g. 5.14.163.81)