summaryrefslogtreecommitdiff
path: root/coturn.html
blob: 6bbd89e580ac44a361c0da2ad87e86b3880f0b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang=en>
    <head>
        <title>Coturn &ndash; LandChad.net</title>
        <meta charset="utf-8"/>
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
        <link rel='stylesheet' type='text/css' href='style.css'>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'>
    </head>
<body>
    <header><h1>Coturn</h1></header>
    <nav></nav>
    <main>

        <img class=titleimg src="pix/webrtc.svg" alt="WebRTC logo">
	
	<p><a href="https://github.com/coturn/coturn">Coturn</a> is a libre <strong>STUN</strong> and <strong>TURN</strong> server software that allows users of chat protcols (Such as <a href="xmpp.html">XMPP</a> and <a href="matrix.html">Matrix</a>) to perform WebRTC <strong>voice and video calls</strong> despite them being behind NATs.</p>

	<p>Almost every self-hosted voice and video conferencing program (such as <a href="jitsi.html">Jitsi</a> and <a href="nextcloud.html">Nextcloud's</a> Talk app) will <strong>require</strong> Coturn or some other equivalent turnserver to function properly.</p>

	<h2>Installation</h2>

	<p>Coturn is available in the Debian repositories:</p>

	<pre><code>apt install coturn</code></pre>

	<h2>Configuration</h2>
	
	<h3>Base configuration</h3>

	<p>Coturn's configuration file is <code>/etc/turnserver.conf</code>. There are a few aspects that need to be changed in order to get a fully-functioning turnserver.</p>

	<p>Here is an example of some sane defaults:</p>

	<pre><code>server-name=<strong>turn.example.org</strong>
realm=<strong>turn.example.org</strong>
listening-ip=<strong>your_public_ip</strong>

listening-port=3478
min-port=10000
max-port=20000

## The "verbose" option is useful for debugging issues
verbose</code></pre>

	<h3>Authentication</h3>

	<p>There are two options for authentication on a turnserver:</p>
	<ol>
		<li><strong>Usernames</strong> and <strong>passwords,</strong></li>
		<li>or <strong>authentication secrets.</strong></li>
	</ol>

	<p>Depending on what self-hosted service is being used in conjunction with Coturn, you may need one or the other of these two options.</p>

	<h4>Usernames and Passwords</h4>

	<p>To utilize username and password authentication with Coturn, add the following configuration in <code>turnserver.conf</code>:</p>

	<pre><code>lt-cred-mech
user=<strong>username</strong>:<strong>password</strong></code></pre>

	<h4>Authentication Secrets</h4>

	<p>To utilize authentication secrets with Coturn, add the following configuration in <code>turnserver.conf</code>:</p>

	<pre><code>use-auth-secret
static-auth-secret=<strong>your_auth_secret</strong></code></pre>

	<h2>TURNS (TLS Encryption)</h2>

	<p>Some self-hosted services (such as Matrix and XMPP) may support the use of <strong>TURNS:</strong> An encrypted version of TURN, which allows for WebRTC connections to be established with the use of an encrypted TLS tunnel, just like HTTPS allows for encrypted viewing of websites.</p>

	<p>To utilize TURNS, certificates need to be declared for <strong>turn.example.org</strong> in <code>turnserver.conf</code>:
	<pre><code>cert=/etc/letsencrypt/live/<strong>turn.example.org</strong>/fullchain.pem
pkey=/etc/letsencrypt/live/<strong>turn.example.org</strong>/privkey.pem</pre></code>

	<h2>Starting Coturn</h2>

	<p>After all configuration changes are complete, Coturn can be started with its systemd daemon:</p>

	<pre><code>systemctl restart coturn</code></pre>

	<p>Congratulations! You've successfully setup a Coturn server!</p>

	<hr>
        <p><em>Written by <a href="https://denshi.org">Denshi.</a> Donate Monero <a href="https://denshi.org/donate.html">here</a> <a href="https://denshi.org/images/monero.jpg">[QR]</a></em></p>

    </main>
	<footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><a href="index.html"><li><img src="pix/chad.gif" alt="chad"></li></a><a href="rss.xml"><li><img src="pix/rss.svg" alt="RSS"></li></a><a href="pix/btc.png"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="pix/xmr.png"><li><img src="pix/xmr.svg" alt="XMR"></li></a><a href="https://github.com/lukesmithxyz/landchad"><li><img src="pix/git.svg" alt="Github"></li></a></footer>
</body>
</html>