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.
Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.
Source ↗ Project ↗ ★ 14.4k ⚑ Report an issue
Save as values.hcl, edit, then run:
# 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
}
| Name | Type | Default | Description |
|---|---|---|---|
| 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. |
No variables match.
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.
nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run coturn --registry=nomploy
| 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.