Set Up Your Own Relay (TURN) Server for Any Display

Any Display product team

A relay (TURN) server passes video, audio, and input between two devices when they cannot connect to each other directly. Any Display normally connects devices directly, but on networks that block direct connections — many office and school networks and some mobile carriers — Remote control and Remote camera need a relay server to connect.

Why is it needed? On the internet, each device usually sits behind its own router or carrier equipment, so the two cannot always reach each other's address. Any Display usually finds a direct path anyway, but strict networks block it. A relay server that both devices can reach solves this: the devices connect through it instead. Video stays encrypted between your devices, so the server cannot see the content. This guide shows how to install the free coturn TURN server on a Mac, Linux, or Windows computer, choose a username and password, and enter them in the app.

Key points

When do you need a relay server?

Controlling your home computer from an office or school network

Strict networks often block direct device-to-device traffic. Going through your relay gets the connection through.

Watching Remote camera over mobile data

Some carrier networks rarely allow direct connections. Even through a home relay, the delay is usually close to real time.

A connection that stays on Connecting

If devices on the same account keep waiting during a remote connection, direct connections may be blocked.

  1. 1

    Prepare: the server computer and its addresses

    Install the relay on a computer that is always on: a Mac mini, a Linux mini PC, a Windows PC, or a cloud server (VPS). Write down two addresses first. For the public IP, run curl -4 ifconfig.me in a terminal on that computer. For the local IP, run ipconfig getifaddr en0 on a Mac, hostname -I on Linux, or ipconfig on Windows (for example 192.168.0.20).

    Reserve that local IP for the computer in your router's DHCP settings so port forwarding keeps working later.

  2. 2

    Create the config file and choose a username and password

    All three systems use one turnserver.conf file like the one below. The user= line is the username and password you will enter in Any Display. The format is user=username:password — replace myname and CHANGE-THIS-LONG-PASSWORD with your own values. Use a long random password; openssl rand -base64 24 in a terminal makes one. Do not use a colon (:) in the password.

    Behind a router, write external-ip as public-IP/local-IP using the values from the previous step. On a VPS whose public IP is on the server itself, you can delete that line. min-port to max-port is the UDP range used for relaying. 41 ports are plenty for personal use; widen it if many people connect at once.

    listening-port=3478
    fingerprint
    lt-cred-mech
    realm=anydisplay
    user=myname:CHANGE-THIS-LONG-PASSWORD
    min-port=49160
    max-port=49200
    external-ip=203.0.113.10/192.168.0.20
    no-tls
    no-dtls
    no-cli
    no-multicast-peers
  3. 3

    Install on macOS (Homebrew)

    With Homebrew installed, run the commands below in Terminal. The second command opens the config file: paste the settings from the previous step and save (in nano: Control+O, Enter, Control+X). On an Intel Mac the path is /usr/local/etc/turnserver.conf.

    sudo brew services start coturn starts the relay automatically whenever the Mac boots, even before anyone logs in. If the firewall in System Settings › Network › Firewall is on, allow incoming connections for turnserver.

    brew install coturn
    nano /opt/homebrew/etc/turnserver.conf
    sudo brew services start coturn
  4. 4

    Install on Linux (Ubuntu or Debian)

    Install coturn with the commands below and put the settings from the earlier step in /etc/turnserver.conf. Older Debian and Ubuntu packages only start after you remove the # in front of TURNSERVER_ENABLED=1 in /etc/default/coturn. systemctl enable --now starts it now and after every reboot.

    Skip the last two lines if you do not use the ufw firewall. On Fedora or RHEL, install with sudo dnf install coturn; the config file is /etc/coturn/turnserver.conf. On a cloud server, also open UDP 3478 and 49160–49200 in the provider's security group or firewall.

    sudo apt update && sudo apt install coturn
    sudo nano /etc/turnserver.conf
    sudo systemctl enable --now coturn
    sudo ufw allow 3478/udp
    sudo ufw allow 49160:49200/udp
  5. 5

    Install on Windows (Docker Desktop)

    coturn has no official Windows installer, so run the official coturn image with the free Docker Desktop. Install Docker Desktop and turn on Start Docker Desktop when you sign in. Then run the commands below in PowerShell. When Notepad opens, paste the settings from the earlier step and save.

    On Windows, write only the public IP: external-ip=public-IP. Run the last firewall command in PowerShell as administrator. Because of --restart unless-stopped, the relay comes back whenever Docker starts after a reboot.

    mkdir C:\coturn
    notepad C:\coturn\turnserver.conf
    docker run -d --name coturn --restart unless-stopped -p 3478:3478/udp -p 49160-49200:49160-49200/udp -v C:\coturn\turnserver.conf:/etc/coturn/turnserver.conf coturn/coturn
    New-NetFirewallRule -DisplayName "Any Display TURN" -Direction Inbound -Protocol UDP -LocalPort 3478,49160-49200 -Action Allow
  6. 6

    Forward ports on your router

    In your router's Port forwarding (Port forward or Virtual server) page, add two rules to the server computer's local IP: UDP 3478 → 3478 and UDP 49160–49200 → 49160–49200. The protocol must include UDP.

    If your router sits behind another ISP router, or your ISP does not give you a public IP (CGNAT), the home server cannot be reached from outside. Use a cloud server (VPS) with Linux instead.

  7. 7

    Change the username or password and restart

    To change the username or password, edit the user= line in turnserver.conf and restart the relay. Add several user= lines to give each person their own account; a removed account stops working after the restart. The restart command for each system is below.

    If you change the password, update the password saved in Any Display as well.

    # macOS
    sudo brew services restart coturn
    # Linux
    sudo systemctl restart coturn
    # Windows (Docker)
    docker restart coturn
  8. 8

    Enter it in the computer app

    In Any Display on Mac or Windows, open Settings › Network › Relay server (TURN). Turn on Use relay server and enter the Server address as turn:public-IP:3478 (example below). Without a fixed address, you can use your router's DDNS name, such as turn:myhome.example.com:3478. Enter the values from the user= line as Username and Password.

    Click Test connection. When it says the server is reachable and can relay, click Save. Type a Server name and click Save to list to keep it under Saved servers so you can load it again later.

    turn:203.0.113.10:3478
  9. 9

    Enter it in the phone or tablet app

    In Any Display on iPhone, iPad, or Android, open Settings › Relay server (TURN), enter the same server address, username, and password as on the computer, then tap Test connection and Save. One side is enough, but if you often connect from mobile data, setting it on the phone is convenient.

  10. 10

    Troubleshoot with Test connection

    If the server does not respond, check the address and port, that the server computer is on, UDP 3478 forwarding on the router, and the server firewall. If testing the public IP from inside the same network gets no response, your router may not support hairpin NAT (NAT loopback); switch to mobile data and test again.

    If sign-in fails, the server was reached but the username or password is wrong. Check that it matches the user= line exactly, including upper and lower case, and restart the server after editing. If the test passes but the remote screen never appears, check the 49160–49200 forwarding.

Do both devices need the relay settings?
No. Setting it on one of the two devices is enough. Different servers on each side also work.
Can the person running the relay see my screen?
No. Video and audio pass through the server encrypted between your devices, and the server cannot decrypt them.
Can I use turns: (TLS)?
Any Display's fast UDP path uses turn: (UDP) only. We recommend the turn:address:3478 format for the best results.
What if my public IP changes?
Update external-ip in turnserver.conf and restart the server. If the app uses a DDNS name as the server address, you do not need to change it there.
Can several people share one relay?
Yes. Add one user= line per person, and widen the min-port to max-port range and the port forwarding if many connect at once.

Review basis

Checked on October 8, 2026 with a macOS relay (Homebrew coturn 4.18.0) and an Any Display Remote camera connection. The Linux and Windows steps follow coturn's official package and Docker image documentation.

Limitations to know

Official sources

Download Any DisplayPricing