coturn turnserver fails to bind its listening address and port 3478
turnserver fails at start-up with a bind error for port 3478Short answer
The operating system refused the bind. Either the address and port are already taken, often by a second turnserver, or the address in listening-ip does not exist on the machine, which is common on cloud hosts where the public address is NAT. Find the holder with ss, then correct listening-ip and external-ip.
Fix it fast
1Find out which cause you have
See which process already listens on the TURN port, over TCP and UDP. Empty output means the problem is the address, not the port.
sudo ss -lntup | grep 34782Match what you see, then jump to its fix
What does the error look like?
turnserver fails at start-up with a bind error for port 3478EADDRINUSE: the given address is already in useEADDRNOTAVAIL: a nonexistent interface was requested or the requested address was not local
Cause 1 of 2
Another process, often a second turnserver, already holds the port
1Check
Look at the process name that ss prints, and list running turnserver processes.
sudo ss -lntup | grep 3478
pgrep -a turnserver2Fix
Stop the extra process, or give your instance a different port with listening-port in turnserver.conf (default 3478 for UDP and TCP).
# /etc/turnserver.conf
listening-port=34793Verify
Start turnserver again and confirm it holds the port.
sudo ss -lntup | grep turnserverConfirmed by man7.org
Cause 2 of 2
listening-ip names an address that is not on this machine
1Check
Compare each listening-ip line in the config with the addresses the machine really has. A cloud VM behind NAT has only its private address on the interface.
grep -n "listening-ip\|external-ip\|relay-ip" /etc/turnserver.conf
ip -brief addr2Fix
Put a local address in listening-ip, or remove the line to listen on all addresses, and describe the public address with external-ip (public/private mapping).
# /etc/turnserver.conf
listening-ip=10.0.0.5
external-ip=203.0.113.10/10.0.0.53Verify
Restart and check that turnserver listens on the address.
sudo ss -lntup | grep 3478Confirmed by raw.githubusercontent.com
How do I stop it coming back?
- Run one turnserver per port and keep a single place that starts it.
- Always state the NAT mapping with external-ip on cloud hosts instead of a public address in listening-ip.
- Restart the service after each config edit and read its first log lines.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix