Deploying on Ubuntu with native services and executables


Installation process

Only Ubuntu xenial 16.04 is supported.

1. Install KMS

sudo echo "deb http://ubuntu.openvidu.io/6.7.2 xenial kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --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

stunServerAddress=YOUR_MACHINE_PUBLIC_IP
stunServerPort=3478

5. File /etc/turnserver.conf

external-ip=YOUR_MACHINE_PUBLIC_IP
listening-port=3478
fingerprint
lt-cred-mech
max-port=65535
min-port=49152
pidfile="/var/run/turnserver.pid"
realm=openvidu
simple-log
redis-userdb="ip=127.0.0.1 dbname=0 password=turn connect_timeout=30"
verbose

6. File /etc/default/coturn

TURNSERVER_ENABLED=1

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.jar &

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:

wget https://github.com/OpenVidu/openvidu/releases/download/v{VERSION}/openvidu-server-{VERSION}.jar

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.

Architectures

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