Deploying on Ubuntu with native services and executables

Installation process

Only Ubuntu xenial 16.04 is supported.

1. Install KMS

sudo echo "deb xenial kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
sudo apt-key adv --keyserver --recv-keys 5AFA7A83
sudo apt-get update
sudo apt-get -y install kurento-media-server

2. Install COTURN

sudo apt-get -y install coturn

This is a great implementation of a STUN/TURN server, necessary for connecting your users under some complicated circumstances. You can check its documentation here.

3. Install Redis

sudo apt-get -y install redis-server

4. File /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini


5. File /etc/turnserver.conf

redis-userdb="ip= dbname=0 password=turn connect_timeout=30"

6. File /etc/default/coturn


7. Init services

sudo service redis-server restart
sudo service coturn restart
sudo service kurento-media-server restart

8. Init Openvidu Server JAR executable

java -jar -Dopenvidu.secret=YOUR_SECRET -Dopenvidu.publicurl=https://YOUR_MACHINE_PUBLIC_IP:4443/ openvidu-server-{VERSION}.jar &

Being YOUR_SECRET the password you want for securing your OpenVidu Server. This will be needed for connecting to OpenVidu Server dashboard and for consuming OpenVidu Server REST API. Keep it safe!

You will need Java 8 to run OpenVidu Server:

sudo apt-get install -y openjdk-8-jre

You can get any version of OpenVidu Server running:


Go to Using your own certificate to add your certificate to the JAR instead of using the self-signed default one (which will launch a security warning on the user's browser).

9. Finally check your server

You can connect to OpenVidu dashboard through https://YOUR_OPENVIDU_SERVER_MACHINE_PUBLIC_IP:4443 (authorization is OPENVIDUAPP:YOUR_SECRET). Make sure you allow TCP and UDP inbound connections to your machine!

To connect your application to OpenVidu Server, use the same URL https://YOUR_OPENVIDU_SERVER_MACHINE_PUBLIC_IP:4443. To learn more, this scenario is exactly the same as portrayed here.

Server network requirements

In order for this deployment to work, you will have to meet 2 sets of needs in the machine hosting your services:

  • First of all, you certainly need the machine to have a public, reachable IP. The reason is pretty simple: we are precisely installing COTURN service to cover those situations where the final users are hidden behind NATs or complex networks (learn more). If the COTURN itself is running inside an unreachable machine, your video transmission will probably fail.

  • Besides, the server needs some ports opened in the firewall:

    • 4443 TCP (OpenVidu Server listens on port 4443 by default)
    • 3478 TCP (COTURN listens on port 3478 by default)
    • 49152 - 65535 UDP (these ports are recommended to be opened, as WebRTC randomly exchanges media through any of them)

If you were still in trouble, we provide a ready-to-use Amazon CloudFormation Stack to easily deploy OpenVidu in just a few minutes here.


You can have the following scenarios depending on how many machines you have and what architecture you prefer. What are the advantages and disadvantages of each one of them? Well, it really depends on the power of the machine, the nature of your application and the load expected. In general, having all the services running in one machine will reduce its performance and scalability, but on the other hand, makes it easier the process of installation, configuration and launching.

If you are deploying with these instructions for the first time, we recommend using only one machine. When you verify that everything is working as expected, you can try different configurations to compare overall performance and load capacity.

  1. App, OpenVidu Server and KMS run in the same machine
  2. App runs in its own machine. OpenVidu Server and KMS run in the same machine
  3. App, OpenVidu Server and KMS all run in different machines

The instructions above portray scenarios 1 and 2 in the image. In other words, we are supposing that OpenVidu Server and KMS will be hosted in the same machine. The only difference between options 1-2 and option 3 is that for step 8 another parameter is required when launching your openvidu-server:

java -Dopenvidu.secret=YOUR_SECRET -Dopenvidu.publicurl=https://YOUR_MACHINE_PUBLIC_IP:4443/ -Dkms.uris=[\"ws://YOUR_KMS_MACHINE_IP:8888/kurento\"] -jar openvidu-server.jar