Skip to content

coturn setup in AWS EC2 intance


It may be useful to deploy a TURN server for users to publish and play streams with media ports closed on users side. If internal TURN server is not enough for some reasons, and it is not desireable to deploy a separate AWS EC2 instance for this task, or the server should be used in autoscaling group, the coturn server can be deployed in the same instance with WCS.

WCS EC2 instance deploying

Deploy AWS EC2 WCS instance as described here. Add TCP port 443 to security group while launching the instance.

WCS configuration

Add the following parameter to file


and restart WCS.

coturn installation and configuration

  1. Install coturn from epel-release repository

    sudo amazon-linux-extras install epel
    sudo yum install coturn

  2. Set the following parameters in coturn configuration file /etc/coturn/turnserver.conf

    # Listen port  443
    # Listen on internal IP only
    # Set up external IP option as coturn manual recommends
    # Set user and password
    # Set the domain
    # Disable UDP listener
    # SSL certificate and key
    Leave the rest of coturn parameters by default

  3. Add the following parameter to [Service] section of the /lib/systemd/system/coturn.service file to allow coturn to listen TCP port 443


  4. Launch coturn

    sudo systemctl start coturn


Open Firewall Traversal Streaming example page in Chrome browser, set your server name and port 443 to TURN server field, set username and password you configured in coturn settings, then publish and play a stream