Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

coturn turnserver fails to bind its listening address and port 3478

Errorturnserver fails at start-up with a bind error for port 3478

Short 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.

  • Applies to coturn current release, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 3478
  2. 2Match what you see, then jump to its fix

    1. 1EADDRINUSE, and ss shows a process on 3478Another process, often a second turnserver, already holds the portFix
    2. 2EADDRNOTAVAIL, and the IP in the error is missing from the output of ip addrlistening-ip names an address that is not on this machineFix

What does the error look like?

  • turnserver fails at start-up with a bind error for port 3478
  • EADDRINUSE: the given address is already in use
  • EADDRNOTAVAIL: 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 turnserver

2Fix

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=3479

3Verify

Start turnserver again and confirm it holds the port.

sudo ss -lntup | grep turnserver

Confirmed by man7.org

Did this fix it?

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 addr

2Fix

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.5

3Verify

Restart and check that turnserver listens on the address.

sudo ss -lntup | grep 3478

Confirmed by raw.githubusercontent.com

Did this fix it?

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.