How to build own TURN server for Windows

This article suits more for a blog, but I've decided to share this information on our articles section.

I have not found any good article on this topic, or maybe I just can't search properly :(

We, MyChat developers, are using the TURN server for Windows that I built back in 2015 when we started to develop calls in the chat. Now I want to update it. But I've faced the struggle with repeat building of the TURN server. I did it before, but I completely forgot how.

After some googling, I found a general guide for building coturn in the blog of Muaz Khan. But I saw a typical Linux-like picture: several points with no details.

Let's try another, a Windows-one-mouse-click way.

Firstly, download the Linux console emulator Cygwin. I took a 38-bit variant as our server must work in all systems including the old ones:

Secondly, take coturn source files

I've made mirror copies on our hosting just in case:

Cygwin —

Coturn —

Let's install Cygwin.

Choose the Internet as a download source for packages:

Installing Cygwin

Next, choose the folder location with Cygwin and place for downloading packages before installation. You can delete them later after the installation process.

I chose the first file source, but you can choose any other if you want. Just make sure that it has the packages you need:

Installing Cygwin, choosing the download source

Press next, and you will see this window:

Installing Cygwin, preparing files

I a drop-down list "view" select "full" and search packages you need. For each package, in the column "new" in the list, mark the latest version from all available (except text ones):

Installing Cygwin, choosing packages version

A list of packages that I installed (you can skip packages with "64" in the title as you do not need them for a 32-bit system):

Installing Cygwin, a list of download packages

Find one-by-one all specified packages and select the installation version. Press "Next" and watch the exciting installation process:

Installing Cygwin, copying files

When the installation is complete, open the folder in the Explorer with installed Cygwin -> home -> (your user name), and unzip Coturn files here. You will see the following:

folder with installed Cygwin

Now, launch the emulator Cygwin.bat.

As I got used to normal navigation for disk structure, I launch mc (Midnight Commander).

It immediately opens a user home folder with the folder "coturn-master". Enter this folder and run "configure" to make a build script.

Preparing makefile

Makefile is ready, let's make a build. Write the command "make", run it, and wait for the result:

Building turn

And the final step, write and rung the command "make install":

Installing turn

That's all folks, your turn server is ready to work.

We need a minimum functionality for calls over the server.

I mercilessly cut the content of the turn server to avoid useless files. I won't describe the whole cleaning process, it is better to show the result:

turn server files

That is all you need for the turn server regular work. The folder "etc" has a file with configuration "turnserver.conf". You can configure this file and enjoy the work of own TURN server for Windows (the file "turnserver.conf.default" has a description for configuration).

Download TURN for Windows

Discuss on the forum

Служба поддержки