2.5 KiB
Install Coturn STUN/TURN server
Requirements
- Recommended: Hetzner (
CPX11it's enough, OS:Ubuntu 20.04 LTS / 22.04.1 LTS). - Use my personal link to receive
€20 in cloud credits. - Your domain name, example:
your.domain.name- Set a DNS A record for that domain that point to Your Server public IPv4
DNS A Record: The Address Mapping record (or DNS host record) stores a hostname and its corresponding IPv4 address. When users search for your website, the A record redirects this traffic from the web address (xxxxx.com – human-readable domain) to the IPv4 address.
- Set a DNS A record for that domain that point to Your Server public IPv4
your.usernameandyour.passwordto set in the/etc/turnserver.conf.- Certbot to generate
cert&pkey.
Quick start
- Download coturn
$ sudo apt-get -y update
$ sudo apt-get -y install coturn
- Uncomment the following line to run Coturn as an automatic system service daemon in
/etc/default/coturn
TURNSERVER_ENABLED=1
- Set
/etc/turnserver.confto the following:
listening-port=3478
tls-listening-port=5349
min-port=10000
max-port=20000
fingerprint
lt-cred-mech
user=your.username:your.password
server_name=your.domain.name
realm=your.domain.name
total-quota=100
stale-nonce=600
cert=/etc/letsencrypt/live/your.domain.name/fullchain.pem
pkey=/etc/letsencrypt/live/your.domain.name/privkey.pem
cipher-list="ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384"
no-stdout-log
- If you can't reach coturn on
tls-listening-port, try to edit/etc/systemd/system/multi-user.target.wants/coturn.service
[Service]
User=root
Group=root
- Reload daemon:
$ sudo systemctl daemon-reload
Test
Test if it's working:
Or use the built in MiroTalk P2P service, just change your.domain.name, your.username and your.password with your own, in the following urls:
-
https://p2p.mirotalk.com/test?iceServers=[{"urls":"stun:your.domain.name:3478"},{"urls":"turn:your.domain.name:3478","username":"your.username","credential":"your.password"}]
-
https://p2p.mirotalk.com/test?iceServers=[{"urls":"stun:your.domain.name:5349"},{"urls":"turn:your.domain.name:5349","username":"your.username","credential":"your.password"}]
