coturn/docker/coturn
Hyorin Choi ab1292059f
Update turnserver.conf (#1009)
Made some text proofreading
2022-10-26 22:53:32 +02:00
..
alpine Upgrade Docker image to 4.6.0 Coturn version 2022-09-13 12:38:37 +03:00
debian Upgrade Docker image to 4.6.0 Coturn version 2022-09-13 12:38:37 +03:00
rootfs/usr/local/bin Hack IFS in 'detect-external-ip' script of Docker image to support both Debian and Alpine 2021-05-17 23:38:38 +03:00
tests Aid alpine Docker image for 4.5.2 Coturn release 2021-06-03 14:22:51 +03:00
.gitignore Ignore key files for Docker Compose to not pollute Git 2021-04-13 11:48:17 +03:00
CHANGELOG.md Upgrade Docker image to 4.6.0 Coturn version 2022-09-13 12:38:37 +03:00
CONTRIBUTING.md Upgrade alpine to 3.15 version in Docker image 2021-11-25 10:42:44 +01:00
coturn.env split dockerfiles based on db 2018-10-23 07:44:03 +02:00
Makefile Upgrade Docker image to 4.6.0 Coturn version 2022-09-13 12:38:37 +03:00
package.json Add 'debian' image and run as non-root 2021-04-01 17:41:55 +03:00
README.md Upgrade Docker image to 4.6.0 Coturn version 2022-09-13 12:38:37 +03:00
turnserver.conf Update turnserver.conf (#1009) 2022-10-26 22:53:32 +02:00

Coturn TURN server Docker image

Docker CI Docker Hub

Docker Hub | GitHub Container Registry | Quay.io

Changelog

Supported platforms

  • linux/amd64
  • linux/arm64
  • linux/arm/v6
  • linux/arm/v7
  • linux/ppc64le
  • linux/s390x

What is Coturn TURN server?

The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server and gateway, too.

github.com/coturn/coturn

How to use this image

To run Coturn TURN server just start the container:

docker run -d -p 3478:3478 -p 3478:3478/udp -p 5349:5349 -p 5349:5349/udp -p 49152-65535:49152-65535/udp coturn/coturn

Why so many ports opened?

As per RFC 5766 Section 6.2, these are the ports that the TURN server will use to exchange media.

You can change them with min-port and max-port Coturn configuration options:

docker run -d -p 3478:3478 -p 3478:3478/udp -p 5349:5349 -p 5349:5349/udp -p 49160-49200:49160-49200/udp \
       coturn/coturn -n --log-file=stdout \
                        --external-ip='$(detect-external-ip)' \
                        --min-port=49160 --max-port=49200

Or just use the host network directly (recommended, as Docker performs badly with large port ranges):

docker run -d --network=host coturn/coturn

Configuration

By default, default Coturn configuration and CLI options provided in the CMD Dockerfile instruction are used.

  1. You may either specify your own configuration file instead.

    docker run -d --network=host \
               -v $(pwd)/my.conf:/etc/coturn/turnserver.conf \
           coturn/coturn
    
  2. Or specify command line options directly.

    docker run -d --network=host coturn/coturn \
               -n --log-file=stdout \
               --min-port=49160 --max-port=49200 \
               --lt-cred-mech --fingerprint \
               --no-multicast-peers --no-cli \
               --no-tlsv1 --no-tlsv1_1 \
               --realm=my.realm.org \  
    
  3. Or even specify another configuration file.

    docker run -d --network=host  \
               -v $(pwd)/my.conf:/my/coturn.conf \
           coturn/coturn -c /my/coturn.conf
    

Automatic detection of external IP

detect-external-ip binary may be used to automatically detect external IP of TURN server in runtime. It's okay to use it multiple times (the value will be evaluated only once).

docker run -d --network=host coturn/coturn \
           -n --log-file=stdout \
           --external-ip='$(detect-external-ip)' \
           --relay-ip='$(detect-external-ip)'

By default, IPv4 address is discovered. In case you need an IPv6 one, specify the --ipv6 flag:

docker run -d --network=host coturn/coturn \
           -n --log-file=stdout \
           --external-ip='$(detect-external-ip --ipv6)' \
           --relay-ip='$(detect-external-ip --ipv6)'

Persistence

By default, Coturn Docker image persists its data in /var/lib/coturn/ directory.

You can speedup Coturn simply by using tmpfs for that:

docker run -d --network=host --mount type=tmpfs,destination=/var/lib/coturn coturn/coturn

Image versions

X

Latest tag of X Coturn's major version.

X.Y

Latest tag of X Coturn's minor version.

X.Y.Z or X.Y.Z.W

Latest tag version of a concrete X.Y.Z or X.Y.Z.W version of Coturn.

X.Y.Z-rN or X.Y.Z.W-rN

Concrete N image revision tag of a Coturn's concrete X.Y.Z or X.Y.Z.W version.

Once build, it's never updated.

alpine

This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

edge

Contains build of Coturn's latest master branch.

License

Coturn and its Docker images are licensed under this license.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Issues

We can't notice comments in the DockerHub (or other container registries) so don't use them for reporting issue or asking question.

If you have any problems with or questions about this image, please contact us through a GitHub issue.