<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: KhvichaDev</title>
    <description>The latest articles on DEV Community by KhvichaDev (@khvichadev).</description>
    <link>https://dev.to/khvichadev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4026996%2F2a10d80c-fa1b-49c5-81af-0cd0c57e01ce.jpg</url>
      <title>DEV Community: KhvichaDev</title>
      <link>https://dev.to/khvichadev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khvichadev"/>
    <language>en</language>
    <item>
      <title>A Definitive Guide to Configuring coTURN on Oracle Cloud Infrastructure (OCI) Free Tier for WebRTC</title>
      <dc:creator>KhvichaDev</dc:creator>
      <pubDate>Mon, 13 Jul 2026 09:38:04 +0000</pubDate>
      <link>https://dev.to/khvichadev/a-definitive-guide-to-configuring-coturn-on-oracle-cloud-infrastructure-oci-free-tier-for-webrtc-igf</link>
      <guid>https://dev.to/khvichadev/a-definitive-guide-to-configuring-coturn-on-oracle-cloud-infrastructure-oci-free-tier-for-webrtc-igf</guid>
      <description>&lt;p&gt;This guide provides a comprehensive, step-by-step walkthrough to deploy and configure a private coTURN server for WebRTC audio/video calls on a free-tier Oracle Cloud Infrastructure (OCI) Ubuntu VPS. This setup is fully framework-agnostic and will work with any WebRTC client (Web, Mobile, Desktop, Unity, etc.).&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Prerequisite: Account Activation&lt;/li&gt;
&lt;li&gt;Step 1: Create the Virtual Cloud Network (VCN Wizard)&lt;/li&gt;
&lt;li&gt;Step 2: Create and Launch the Ubuntu VM (Compute Instance)&lt;/li&gt;
&lt;li&gt;Step 3: Open OCI Network Security Ports (Security List)&lt;/li&gt;
&lt;li&gt;Step 4: Connect via SSH&lt;/li&gt;
&lt;li&gt;Step 5: Install and Configure coTURN on the VM&lt;/li&gt;
&lt;li&gt;Step 6: Configure OS-level Firewall (VPS)&lt;/li&gt;
&lt;li&gt;Step 7: Start and Monitor coTURN&lt;/li&gt;
&lt;li&gt;Step 8: WebRTC Client Configuration (Standard JS API)&lt;/li&gt;
&lt;li&gt;Verification: Test Your TURN Server&lt;/li&gt;
&lt;li&gt;Troubleshooting&lt;/li&gt;
&lt;li&gt;License&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architecture Flow
&lt;/h2&gt;

&lt;p&gt;Below is a visual representation of how the TURN server acts as an encrypted media relay when direct peer-to-peer (P2P) host connection is blocked by Carrier-Grade NAT (CGNAT) on cellular networks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    subgraph Direct_P2P [Attempt 1: Direct Host-to-Host]
        Client_A_Local[Client A] -.-&amp;gt;|Direct P2P Blocked by CGNAT| Client_B_Local[Client B]
    end

    Direct_P2P ~~~ Fallback_Relay

    subgraph Fallback_Relay [Attempt 2: Fallback coTURN Relay]
        Client_A[Client A] &amp;lt;==&amp;gt;|Encrypted SRTP Stream| TURN[coTURN Server on Oracle VPS]
        TURN &amp;lt;==&amp;gt;|Encrypted SRTP Stream| Client_B[Client B]
    end

    style TURN fill:#3b82f6,stroke:#1d4ed8,stroke-width:2px,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Prerequisite: Account Activation
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Oracle Cloud Sign-up&lt;/strong&gt;: Register for a free-tier Oracle Cloud account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait for Activation Banner&lt;/strong&gt;: Immediately after registration, a green banner appears at the top of the home page: &lt;em&gt;“Your account is currently setting up...”&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;&amp;gt; [!IMPORTANT]
&amp;gt; Do &lt;strong&gt;NOT&lt;/strong&gt; attempt to create any networks or servers while this banner is visible. If you do, Oracle will block the creation of public IP addresses and disable network controls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait until the green banner disappears completely&lt;/strong&gt; (usually takes 10–20 minutes) before proceeding to Step 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 1: Create the Virtual Cloud Network (VCN Wizard)
&lt;/h2&gt;

&lt;p&gt;Once the account is fully active, create your network:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;Build&lt;/strong&gt; section on the Home page, click &lt;strong&gt;Networking: Set up a network with a wizard&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Create VCN with Internet Connectivity&lt;/strong&gt; and click &lt;strong&gt;Start VCN Wizard&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Leave all default CIDR blocks and naming fields as they are and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt; at the bottom right.&lt;/li&gt;
&lt;li&gt;Your Virtual Cloud Network (VCN) and Public Subnet are successfully created.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 2: Create and Launch the Ubuntu VM (Compute Instance)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Compute&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Instances&lt;/strong&gt; -&amp;gt; click &lt;strong&gt;Create instance&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image selection&lt;/strong&gt;: Click &lt;strong&gt;Edit&lt;/strong&gt; next to Image and Shape, select &lt;strong&gt;Canonical Ubuntu&lt;/strong&gt; -&amp;gt; version &lt;strong&gt;24.04&lt;/strong&gt; (Shape: &lt;em&gt;VM.Standard.E2.1.Micro&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary Network Settings&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Check &lt;strong&gt;Select existing virtual cloud network&lt;/strong&gt; -&amp;gt; select your wizard-created VCN.&lt;/li&gt;
&lt;li&gt;Check &lt;strong&gt;Select existing subnet&lt;/strong&gt; -&amp;gt; select your public subnet.&lt;/li&gt;
&lt;li&gt;Toggle &lt;strong&gt;Automatically assign public IPv4 address&lt;/strong&gt; to &lt;strong&gt;ON&lt;/strong&gt; (so it turns blue/green).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add SSH keys&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;&amp;gt; [!TIP]
&amp;gt; Click &lt;strong&gt;Download private key&lt;/strong&gt; (saves &lt;code&gt;.key&lt;/code&gt; file) and optionally &lt;strong&gt;Download public key&lt;/strong&gt; (saves &lt;code&gt;.pub&lt;/code&gt; file) to your computer. Keep these files secure in your Downloads folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt; at the bottom.&lt;/li&gt;
&lt;li&gt;Wait 1 minute for the status badge to turn green (&lt;strong&gt;Running&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;Public IP Address&lt;/strong&gt; and the &lt;strong&gt;Private IP Address&lt;/strong&gt; of your running instance.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 3: Open OCI Network Security Ports (Security List)
&lt;/h2&gt;

&lt;p&gt;OCI blocks all ports except 22 by default.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Networking&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Virtual Cloud Networks&lt;/strong&gt; -&amp;gt; click on your newly created VCN.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Subnets&lt;/strong&gt; (in the horizontal tab), click on your public subnet.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Security Lists&lt;/strong&gt; table, click on the &lt;strong&gt;Default Security List&lt;/strong&gt; for your VCN.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Ingress Rules&lt;/strong&gt; and add these &lt;strong&gt;3 separate rules&lt;/strong&gt; (do &lt;strong&gt;NOT&lt;/strong&gt; use commas, as OCI does not support them):&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Rule 1 (TCP):
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source CIDR&lt;/strong&gt;: &lt;code&gt;0.0.0.0/0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Protocol&lt;/strong&gt;: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Port Range&lt;/strong&gt;: &lt;code&gt;3478-5349&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: &lt;code&gt;coTURN TCP Range&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rule 2 (UDP):
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source CIDR&lt;/strong&gt;: &lt;code&gt;0.0.0.0/0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Protocol&lt;/strong&gt;: &lt;code&gt;UDP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Port Range&lt;/strong&gt;: &lt;code&gt;3478-5349&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: &lt;code&gt;coTURN UDP Range&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rule 3 (UDP Media):
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source CIDR&lt;/strong&gt;: &lt;code&gt;0.0.0.0/0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Protocol&lt;/strong&gt;: &lt;code&gt;UDP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Port Range&lt;/strong&gt;: &lt;code&gt;49152-65535&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: &lt;code&gt;coTURN UDP Media&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Click **Add Ingress Rules&lt;/em&gt;* to save.*&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Connect via SSH
&lt;/h2&gt;

&lt;p&gt;Open PowerShell (on Windows) or Terminal (on Mac/Linux) and execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Navigate to the folder where you saved the SSH keys&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;C:\Users\&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;YourUsername&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;\Downloads&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# 2. Connect via SSH (replace key filename and public IP with yours)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-ssh-key.key"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ubuntu&lt;/span&gt;&lt;span class="err"&gt;@&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;YOUR_SERVER_PUBLIC_IP&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Type &lt;code&gt;yes&lt;/code&gt; when prompted to verify host authenticity.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Install and Configure coTURN on the VM
&lt;/h2&gt;

&lt;p&gt;Once logged in, execute the following commands:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install coTURN
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;coturn &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl stop coturn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Enable coTURN System Daemon
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/#TURNSERVER_ENABLED=1/TURNSERVER_ENABLED=1/'&lt;/span&gt; /etc/default/coturn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Backup Default Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mv&lt;/span&gt; /etc/turnserver.conf /etc/turnserver.conf.backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Create and Edit coTURN Configuration File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/turnserver.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste the following configuration. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[!IMPORTANT]&lt;br&gt;
&lt;strong&gt;NAT Mapping Correction&lt;/strong&gt;: Ensure you map your public IP directly to the private IP in &lt;code&gt;external-ip&lt;/code&gt; using the slash (&lt;code&gt;/&lt;/code&gt;) format so the TURN server knows it is running behind a NAT.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;listening&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;=&lt;span class="m"&gt;3478&lt;/span&gt;
&lt;span class="n"&gt;tls&lt;/span&gt;-&lt;span class="n"&gt;listening&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;=&lt;span class="m"&gt;5349&lt;/span&gt;
&lt;span class="n"&gt;listening&lt;/span&gt;-&lt;span class="n"&gt;ip&lt;/span&gt;=&amp;lt;&lt;span class="n"&gt;YOUR_SERVER_PRIVATE_IP&lt;/span&gt;&amp;gt;
&lt;span class="n"&gt;external&lt;/span&gt;-&lt;span class="n"&gt;ip&lt;/span&gt;=&amp;lt;&lt;span class="n"&gt;YOUR_SERVER_PUBLIC_IP&lt;/span&gt;&amp;gt;/&amp;lt;&lt;span class="n"&gt;YOUR_SERVER_PRIVATE_IP&lt;/span&gt;&amp;gt;
&lt;span class="n"&gt;min&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;=&lt;span class="m"&gt;49152&lt;/span&gt;
&lt;span class="n"&gt;max&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;=&lt;span class="m"&gt;65535&lt;/span&gt;
&lt;span class="n"&gt;no&lt;/span&gt;-&lt;span class="n"&gt;syslog&lt;/span&gt;
&lt;span class="n"&gt;no&lt;/span&gt;-&lt;span class="n"&gt;stdout&lt;/span&gt;-&lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="n"&gt;log&lt;/span&gt;-&lt;span class="n"&gt;file&lt;/span&gt;=/&lt;span class="n"&gt;dev&lt;/span&gt;/&lt;span class="n"&gt;null&lt;/span&gt;
&lt;span class="n"&gt;no&lt;/span&gt;-&lt;span class="n"&gt;cli&lt;/span&gt;
&lt;span class="n"&gt;stale&lt;/span&gt;-&lt;span class="n"&gt;nonce&lt;/span&gt;
&lt;span class="n"&gt;fingerprint&lt;/span&gt;
&lt;span class="n"&gt;lt&lt;/span&gt;-&lt;span class="n"&gt;cred&lt;/span&gt;-&lt;span class="n"&gt;mech&lt;/span&gt;
&lt;span class="n"&gt;user&lt;/span&gt;=&amp;lt;&lt;span class="n"&gt;YOUR_TURN_USERNAME&lt;/span&gt;&amp;gt;:&amp;lt;&lt;span class="n"&gt;YOUR_TURN_PASSWORD&lt;/span&gt;&amp;gt;
&lt;span class="n"&gt;realm&lt;/span&gt;=&amp;lt;&lt;span class="n"&gt;YOUR_REALM_NAME&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Save and Exit: Press **Ctrl+O&lt;/em&gt;&lt;em&gt;, then **Enter&lt;/em&gt;&lt;em&gt;, then **Ctrl+X&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Configure OS-level Firewall (VPS)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Flush default OCI blocking rules&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-F&lt;/span&gt;

&lt;span class="c"&gt;# 2. Install persistent firewall utility (select "Yes" on the purple screen prompts)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;iptables-persistent &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# 3. Save the flushed firewall rules permanently&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;netfilter-persistent save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 7: Start and Monitor coTURN
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Start the service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start coturn

&lt;span class="c"&gt;# 2. Verify status (should show green "active (running)")&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status coturn

&lt;span class="c"&gt;# 3. Monitor live connection logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; coturn &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Press **Ctrl+C&lt;/em&gt;* to stop watching live logs.*&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 8: WebRTC Client Configuration (Standard JS API)
&lt;/h2&gt;

&lt;p&gt;To connect your WebRTC peer connection to the newly deployed coTURN server, initialize your &lt;code&gt;RTCPeerConnection&lt;/code&gt; with the following standard ICE configuration parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;peerConnection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RTCPeerConnection&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;iceServers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stun:stun.l.google.com:19302&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stun:stun1.l.google.com:19302&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stun:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:3478&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;turn:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:3478?transport=udp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;turn:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:3478?transport=tcp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;turn:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:5349?transport=udp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;turn:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:5349?transport=tcp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;YOUR_TURN_USERNAME&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;credential&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;YOUR_TURN_PASSWORD&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Replace placeholders with your server's details. For Flutter/Dart, map these exact JSON key-value pairs into your &lt;code&gt;iceConfiguration&lt;/code&gt; map.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Verification: Test Your TURN Server
&lt;/h2&gt;

&lt;p&gt;You can verify that your TURN server is functioning correctly and successfully generating media relays without writing any code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/" rel="noopener noreferrer"&gt;Official WebRTC Trickle ICE Test Tool&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;ICE servers&lt;/strong&gt;, fill out the credentials:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;STUN or TURN URI&lt;/strong&gt;: &lt;code&gt;turn:&amp;lt;YOUR_SERVER_PUBLIC_IP&amp;gt;:3478?transport=udp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TURN username&lt;/strong&gt;: &lt;code&gt;&amp;lt;YOUR_TURN_USERNAME&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TURN password&lt;/strong&gt;: &lt;code&gt;&amp;lt;YOUR_TURN_PASSWORD&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Server&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Gather candidates&lt;/strong&gt; button at the bottom.&lt;/li&gt;
&lt;li&gt;In the generated table, look at the &lt;strong&gt;Type&lt;/strong&gt; column:

&lt;ul&gt;
&lt;li&gt;If you see a row with &lt;strong&gt;&lt;code&gt;relay&lt;/code&gt;&lt;/strong&gt; in the Type column and your server's Public IP in the address column, &lt;strong&gt;your TURN server is 100% working and ready!&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If you only see &lt;code&gt;host&lt;/code&gt; or &lt;code&gt;srflx&lt;/code&gt; candidates, the connection to the TURN server failed (check ports and credentials).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Issue 1: Connection timed out
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Symptoms&lt;/strong&gt;: The ICE test tool halts or the VPS fails to respond during SSH/TURN requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolution&lt;/strong&gt;:

&lt;ol&gt;
&lt;li&gt;Go to OCI console -&amp;gt; VCN -&amp;gt; Default Security List and verify that rules 1, 2, and 3 are present with the exact port ranges.&lt;/li&gt;
&lt;li&gt;Verify that OS-level firewall rules have been flushed on the VPS (&lt;code&gt;sudo iptables -F&lt;/code&gt; followed by &lt;code&gt;sudo netfilter-persistent save&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Issue 2: TURN authentication failed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Symptoms&lt;/strong&gt;: Live logs show &lt;code&gt;Unauthorized&lt;/code&gt; messages or the ICE tool fails to gather &lt;code&gt;relay&lt;/code&gt; candidates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolution&lt;/strong&gt;:

&lt;ol&gt;
&lt;li&gt;Verify the &lt;code&gt;user&lt;/code&gt; string inside &lt;code&gt;/etc/turnserver.conf&lt;/code&gt;. It must follow the exact syntax: &lt;code&gt;user=username:password&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Make sure to restart the service to apply credentials: &lt;code&gt;sudo systemctl restart coturn&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Issue 3: No &lt;code&gt;relay&lt;/code&gt; candidates are generated
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Symptoms&lt;/strong&gt;: The test runs successfully but does not output any &lt;code&gt;relay&lt;/code&gt; types in the table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolution&lt;/strong&gt;:

&lt;ol&gt;
&lt;li&gt;Ensure the &lt;code&gt;external-ip&lt;/code&gt; parameter in &lt;code&gt;/etc/turnserver.conf&lt;/code&gt; maps the public IP to the private IP: &lt;code&gt;external-ip=&amp;lt;PUBLIC_IP&amp;gt;/&amp;lt;PRIVATE_IP&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ensure the UDP port range &lt;code&gt;49152-65535&lt;/code&gt; is open in both OCI Security Lists and Ubuntu local firewall configurations.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;This project is licensed under the &lt;a href="https://opensource.org/licenses/MIT" rel="noopener noreferrer"&gt;MIT License&lt;/a&gt;. Feel free to use, modify, and share.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>devops</category>
      <category>webrtc</category>
    </item>
    <item>
      <title>A Definitive Guide to Configuring coTURN on Oracle Cloud Infrastructure (OCI) Free Tier for WebRTC</title>
      <dc:creator>KhvichaDev</dc:creator>
      <pubDate>Mon, 13 Jul 2026 09:32:46 +0000</pubDate>
      <link>https://dev.to/khvichadev/a-definitive-guide-to-configuring-coturn-on-oracle-cloud-infrastructure-oci-free-tier-for-webrtc-46d6</link>
      <guid>https://dev.to/khvichadev/a-definitive-guide-to-configuring-coturn-on-oracle-cloud-infrastructure-oci-free-tier-for-webrtc-46d6</guid>
      <description></description>
      <category>cloud</category>
      <category>infrastructure</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
