/

Linux Install


Installing Red5 Pro on a Linux Server

The following describes the steps in installing Red5 Pro on an Ubuntu Linux server. We recommend running Red5 Pro on Linux for optimal performance.

NOTES:

  • If you are hosting on AWS, be aware that the Amazon Linux AMI may not support all of the libraries needed for some Red5 Pro functionality. Please choose the Ubuntu 22.04 AMI.
  • As of release version 9.0.0, Red5 Pro requires Java version 11. Please see this document if you are installing a version prior to 9.0.0.
  • Red5 Pro only has library support for 64-bit operating systems

INSTALLER: For quick deployment, please use the Red5 Pro Installer.


Software Dependencies - Ubuntu

Ubuntu 20.04

You will need to install Java 11 and unzip to run and deploy the Red5 Pro server. In addition, there are several native libraries required for WebRTC support, and jsvc is necessary for running Red5 Pro as a service. NTP service is necessary for autoscaling and communication with any other Red5 Pro servers if you are running a cluster.

Depending on your permissions, you may need to pre-pend the following commands with sudo:

apt-get update
apt-get install -y openjdk-11-jdk unzip libva2 libva-drm2 libva-x11-2 libvdpau1 jsvc ntp

CentOS 8 Stream x64

Depending on your permissions, you may need to pre-pend the following commands with sudo:

yum -y update
yum -y install java-11-openjdk unzip libva libvdpau

You will also need to modify the JAVA_HOME path in your red5pro/red5.sh file to JAVA_HOME="/usr/lib/jvm/jre-11".

CentOS does not support jsvc, so to define Red5 Pro as a service on CentOS you will need to use the legacy init.d service configuration.

Note: the bulk of our testing is done on Ubuntu 22.04 instances, and as such we recommend Ubuntu over CentOS.

Required TCP and UDP Ports

The following Inbound ports need to be open on your server/firewall for Red5 Pro features to work:

PortDescriptionProtocol
22SSHTCP
5080default web access of Red5 Pro/Websockets for WebRTCTCP
443modified HTTPS access of Red5 Pro; secure websockets for WebRTCTCP
1935default Red5 Pro RTMP portTCP
8554default RTSP portTCP
40000-65535TURN/STUN/ICE port range for WebRTCUDP

if you are going to use Let's Encrypt to install your SSL certificate, you will need to open port 80 for that; you can close the port after you have installed the certificate.


Red5 Pro Installation

To install the Red5 Pro Server:

  1. Download the server .zip distribution to your local machine. Make sure to log in with your account on https://account.red5.net and download the server from https://account.red5.net/download.
  2. SFTP the server .zip distribution into the /tmp directory of your server
  3. Choose a location to run your instance and navigate to that directory. For this example, we’re running from /usr/local

    cd /usr/local
  4. Create a new red5pro directory:

    sudo mkdir red5pro
  5. Unzip the Red5 Pro distribution into the new directory:

    sudo unzip red5pro-server-xxx.zip -d /usr/local/red5pro

Your Red5 Pro Server License Key

Red5 Pro server will not function without a valid license key. Your LICENSE.KEY file will be included in your server download in the root of the Red5 Pro server directory (i.e., /usr/local/red5pro). You can find your license key listed on your Red5 Pro Professional account overview page.

Modify Maximum Java Heap Size For Red5 Pro Java Process

You can modify the maximum Java heap size by editing red5.sh. Increasing the maximum heap size will allow the server to assign as much memory from what is available to Red5 Pro when necessary. NOTE: if you configure Red5 Pro as a jsvc service, then you will need to modify the memory allocation in the /lib/systemd/system/red5pro.service file

The default maximum heap size is 2 gigabytes (-Xmx2g), and we recommend that the min (Xms) and max (Xmx) values are set to the same value.

# JAVA options
# ZGC collector https://wiki.openjdk.java.net/display/zgc
# You can set JVM additional options here if you want
if [ -z "$JVM_OPTS" ]; then
    JVM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms2g -Xmx2g -Xverify:none -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:MaxGCPauseMillis=500 -XX:ReservedCodeCacheSize=32m"
fi

Note: Recommended Java Heap Settings can be found on the Optimizating page.

If you want to launch Red5 Pro manually, you can do so now by running sudo ./red5.sh. Note that the process will stop when you close your terminal session. If you want to keep it running, then run sudo ./red5.sh &. To ensure that Red5 Pro starts if your instance reboots, set it up as a service.

Defining Red5 Pro as a Service

Refer to this document to configure Red5 Pro as a service for Ubuntu.

Note: CentOS does not support jsvc, so to define Red5 Pro as a service on CentOS you will need to use the legacy init.d service configuration.