Nomploy Nomad Packs

← All packs

coturn v0.1.0

Networking

coturn — a TURN and STUN server that relays WebRTC media when peers can't connect directly (behind NAT/firewalls). Essential for reliable self-hosted video calls and conferencing (Jitsi, Nextcloud Talk, Matrix). Deployed as a host-networked Nomad service with static long-term credentials.

nomad-pack run coturn --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- coturn

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task turn 3478 image coturn/coturn:latest tracks :latest image bumped today
Variables 13
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run coturn -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "coturn"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The coturn container image. Pin a tag in production.
image = "coturn/coturn:latest"

# Main TURN/STUN listening port (TCP + UDP).
port = 3478

# TURN realm — usually your domain (--realm).
realm = "turn.example.com"

# Long-term-credential username (--user <user>:<password>).
turn_user = "turn"

# Long-term-credential password. CHANGE THIS.
turn_password = "change-me-please"

# Public IP to advertise for relayed candidates (--external-ip). Empty = auto-detect; set it if the node is behind 1:1 NAT.
external_ip = ""

# Lowest UDP relay port (--min-port). Open this range on the firewall.
min_port = 49160

# Highest UDP relay port (--max-port). Keep the range small unless you expect many concurrent calls.
max_port = 49200

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# Resources for the coturn task.
resources = {
    cpu    = 500
    memory = 128
  }
NameTypeDefaultDescription
job_name string
"coturn"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"coturn/coturn:latest"
The coturn container image. Pin a tag in production.
port number
3478
Main TURN/STUN listening port (TCP + UDP).
realm set me string
"turn.example.com"
TURN realm — usually your domain (--realm).
turn_user string
"turn"
Long-term-credential username (--user <user>:<password>).
turn_password set me string
"change-me-please"
Long-term-credential password. CHANGE THIS.
external_ip string
""
Public IP to advertise for relayed candidates (--external-ip). Empty = auto-detect; set it if the node is behind 1:1 NAT.
min_port number
49160
Lowest UDP relay port (--min-port). Open this range on the firewall.
max_port number
49200
Highest UDP relay port (--max-port). Keep the range small unless you expect many concurrent calls.
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 128
  }
Resources for the coturn task.
Readme

coturn

coturn — a mature TURN and STUN server. It relays WebRTC media when two peers can't connect directly (behind NAT or strict firewalls), which is what makes self-hosted video calls reliable — the missing piece for Jitsi, Nextcloud Talk, and Matrix (Element) calls.

Single host-networked Nomad service with static long-term credentials.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run coturn --registry=nomploy

Configure

Variable Default Description
port 3478 Main TURN/STUN port (TCP + UDP).
realm turn.example.com TURN realm — usually your domain (--realm).
turn_user / turn_password turn / change-me-… Long-term credentials (--user). Change the password.
external_ip "" Public IP to advertise (--external-ip); set it if behind 1:1 NAT.
min_port / max_port 49160 / 49200 UDP relay port range. Open it on the firewall.
image coturn/coturn:latest Container image. Pin a tag in production.
resources { cpu = 500, memory = 128 } Task resources.

Point your app's ICE config at turn:<realm>:3478 with the username/password. The UDP relay range (min_port–max_port) must be reachable from the internet, and set external_ip for nodes behind 1:1 NAT. Because the pack is host-networked, the relay ports bind directly with no per-port docker-proxy. Keep the range small unless you expect many concurrent calls.