Installing Red5 Pro on a Linux Server (Ubuntu recommended)

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

Software Dependencies - Ubuntu

We suggest running your server on Ubuntu v16.04. You will need to install Java (recommended version 8 or higher) and unzip to run and deploy Red5 Pro server.

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

apt-get update
apt-get -y install default-jre
apt-get -y install unzip

Depending on your version of Ubuntu, you may also need to install the following libraries to support WebRTC:

apt-get -y install libva1
apt-get -y install libva-drm1
apt-get -y install libva-x11-1
apt-get -y install libvdpau1

Software Dependencies - CentOS

Note: Red5 Pro with WebRTC does not run on CentOS 6 due to an older and less secure version of glibc that has been updated with CentOS 7. If you want to run Red5 Pro on CentOS, you must use build 7 or higher.

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

yum -y update
yum -y install java
yum -y install unzip
rpm --import
rpm -ivh
yum -y update --skip-broken
yum -y --enablerepo=atrpms install libva libvdpau1

Required TCP and UDP Ports

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

Port Description
22 SSH
5080 default web access of Red5 Pro
1935 default Red5 Pro RTMP port
8554 default RTSP port
6262 websockets (for second screen and HLS)
8088 second screen client registry

Ports required for WebRTC server using SSL:

Port Description Protocol
80 modified web access of Red5 Pro TCP
443 standard HTTPS port TCP
1935 default Red5 Pro RTMP port TCP
8554 default RTSP port TCP
6262 websockets for HLS TCP
8081 websockets for WebRTC TCP
8083 secure websockets for WebRTC TCP
40000-65000 TURN/STUN/ICE port range UDP

Red5 Pro Installation

To install the Red5 Pro Server:

  1. Download the server .zip distribution to your local machine. Make sure to login with your account on and download the server from
  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. Copy the server distribution to this directory:
     sudo cp /tmp/
  5. Unzip the Red5 Pro distribution in the directory:
     sudo unzip
  6. For ease of use, rename the Red5 Pro distribution directory to red5pro:
     sudo mv red5-server-xxx-release red5pro

Your Red5 Pro Server License Key

Red5 Pro server will not function without a valid license key. As of release 3.0.0 your LICENSE.KEY file will be included in your server download in the root of the Red5 Pro server directory. You can find your license key listed in your Red5 Pro Professional account overview page.

Add execute permissions to the following files


sudo chmod +x *.sh will do the job.

Modify Maximum Java Heap Size For Red5 Pro Java Process

You can modify the maximum Java heap size by modifying Increasing the maximum heap size will allow the server to assign as much memory from what is available to Red5 Pro when necessary.

The default maximum heap size is 2 gigabytes (-Xmx2g).

# JAVA options
# You can set JVM additional options here if you want
if [ -z "$JVM_OPTS" ]; then
    JVM_OPTS="-Xms256m -Xmx2g -Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true -XX:MaxMetaspaceSize=128m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC"

Defining Red5 Pro as a Service

To allow for ease of startup/shutdown of Red5 Pro, in addition to automatically starting the service on server reboot, you will want to add an init.d script for Red5 Pro.

To begin, create a red5pro file in init.d:

sudo touch /etc/init.d/red5pro

You can copy and paste the following into the red5pro file using your editor of choice:

# chkconfig: 2345 85 85
# description: Red5 Pro streaming server
# Provides:          Red5 Pro
# Required-Start:    $local_fs $network
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Red5Pro
# processname: red5


start() {
  # check to see if the server is already running
  if netstat -an | grep ':5080'; then
    echo "Red5 is already started..."
    while netstat -an | grep ':5080'; do
      # wait 5 seconds and test again
      sleep 5
  cd ${RED5_HOME} && ./ &

stop() {
  cd ${RED5_HOME} && ./

case "$1" in
    exit 1
    exit 1
    exit 1
    echo "Usage: $0 {start|stop|restart}" 1>&2
    exit 1


Make the file executable:

sudo chmod 777 /etc/init.d/red5pro

Configure Red5 Pro to Automatically Start on Boot/Reboot

Run the following commands to configure the Red5 Pro service to start on server startup:

sudo /usr/sbin/update-rc.d red5pro defaults
sudo /usr/sbin/update-rc.d red5pro enable

For CentOS:

sudo systemctl daemon-reload
sudo systemctl enable red5pro.service

Starting / Stopping

The Red5 Pro Server can now be started by issuing:

sudo /etc/init.d/red5pro start

To stop the Red5 Pro Server from running (note, it takes approximately 30 seconds for the server to fully shut down):

sudo /etc/init.d/red5pro stop

Additionally, you can restart the Red5 Pro Server by issuing:

sudo /etc/init.d/red5pro restart

Verifying Red5 Pro is Running

Once you have started the Red5 Pro Server, you can verify that it is running and available by visiting your instance at port 5080.

Open a web browser and navigate to http://__your server ip__:5080 (like

To not publicly expose the default web access at port 5080, you can do either of the following:

  • Don't expose the port 5080 in your Inbound security for the instance.
  • Redefine the default port as the http.port value in the conf/ file of your Red5 Pro Server install.

Red5 Pro WebRTC

Red5 Pro Server Release 2.0.0 (WebRTC Beta2) includes WebRTC support and front-end integration of the Red5 Pro HTML5 SDK.

WebRTC (Web Real-Time Communication) is supported by the Chrome, Firefox and Opera browsers on desktop. In addition, the Chrome browser on Android supports WebRTC. Safari and Internet Explorer do not support WebRTC (but reportedly, Microsoft Edge does).

Broadcasting/subscribing of WebRTC to WebRTC, WebRTC to HLS, WebRTC to Flash, and Flash to WebRTC are all supported.

Subscribing to a WebRTC publisher using the Red5 Pro Android or iOS SDK client is supported. In addition, subscribing with WebRTC to a stream published with Red5 Pro Android or iOS SDK client is supported.

WebRTC Broadcaster/Subscriber combinations supported, in a nutshell:

  • WebRTC <==> WebRTC
  • WebRTC <==> Flash
  • WebRTC <==> Red5 Pro iOS SDK
  • WebRTC <==> Red5 Pro Android SDK
  • WebRTC ==> HLS

WebRTC Overview

WebRTC runs on the standard HTTPS port (443). To publish via WebRTC on a Red5 Pro server you need to have a valid SSL Certificate for a registered URL. Red5 Pro with SSL walks you through setting up the certificate on your server. Additionally, as with other Red5 Pro server distributions, you will need to install Java (minimum version 8.0).

If you are running the server, without an SSL cert, on your local machine or on a server:

  1. You will be able to publish/subscribe locally (between browsers).
  2. You will be able to subscribe to a stream that is being published from localhost (e.g.: http://localhost:5080/live/broadcast.jsp) from a device within the same network (pointing to the IP address of your machine, not to localhost). To subscribe from a mobile device, either via browser on Android, or via SDK client on iOS or Android, the device must be on the same Wifi network as the desktop.
  3. You will not be able to publish via a WebRTC client that is not local to the machine.

How to modify default ports

Some firewalls or even service providers may block some of the Red5 Pro default ports, so you may want to modify those. There are two files that allow you to define the ports that Red5 Pro uses: {red5pro}/conf/, and {red5pro}/conf/red5pro-activation.xml file : RTMP, HTTP, Websockets

To modify the default RTMP port, edit {red5pro}/conf/ RTMP section:


To modify the default HTTP (or HTTPS) port, edit the HTTP section:


To modify the default Websockets port, edit the Websocket section:

# WebSocket

Note: this is also where you define secure websockets (wss) if you need them.

red5pro-activation.xml file: RTSP, secondScreen, websocket (for HLS)

Modify the configuration bean if you wish to modify any of the default ports for RSTP, WebSockets for HLS, or Second Screen:

<bean name="configuration" id="configuration" class="com.red5pro.activation.Red5ProConfiguration">
<property name="rtsp" value="true"/>
<property name="secondscreen" value="true"/>
<property name="websockets" value="true"/>
<property name="rtspPort" value="8554"/>
<property name="secondScreenPort" value="8088"/>
<property name="websocketPort" value="6262"/>
<property name="enableRecording" value="true"/>


  1. Some hosting facilities' virtual servers may not be able to transmit their public/private IP addresses to Red5 Pro server. This information is necessary for the ICE negotiation in WebRTC. In some cases you may need to give the Red5 Pro server a little help by "forcing" these IP assignments. To do so, modify the {red5pro}/conf/ file. Uncomment the following lines and modify with your server's public and private IP addresses.
# Forcing a public IP address

# Forcing a private IP address

If you are still having ICE failures, you may also need to enabled port availability checking by uncommenting:

# Configure port availability checking