Tutorials  /  Linux Basics

Install Red5 Media Server on CentOS 7 – Complete Guide

Ccentron Redaktion · May 2025 ·5 min read ·Linux Basics, Tutorial

Red5 is a Java-based open-source media server that powers Flash-based multi-user applications. It enables live audio and video streaming, shared remote objects for multiplayer gaming, client stream recording (in FLV or AVC+AAC formats), real-time data sync, and more.

This guide walks you through the complete setup process of deploying a Red5 Media Server on a CentOS 7 system.

System Requirements

  • A user account with sudo privileges.
  • A CentOS 7 x64 server, with at least 1 GB of available RAM.
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: Update Your CentOS Server

Before installing any new software, it’s crucial to update the server to the latest available packages. Run the following commands to clean the cache and perform a full system update:

Console
yum clean all
yum -y update

Step 2: Install Java

Red5 requires Java to run. Follow these steps to download and set up the Java SE Development Kit 8 from Oracle’s official source:

Console
cd /opt/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz"
tar xzf jdk-8u161-linux-x64.tar.gz

Configure Java using the alternatives system:

Code
alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 2
alternatives --config java

Now define paths for javac and jar commands using the same method:

Code
alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_161/bin/jar 2
alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 2
alternatives --set jar /opt/jdk1.8.0_161/bin/jar
alternatives --set javac /opt/jdk1.8.0_161/bin/javac

Set Environment Variables

Define the global environment variable for JAVA_HOME as shown:

Console
export JAVA_HOME=/opt/jdk1.8.0_161

Set JRE_HOME and Update the System PATH

To ensure the Java Runtime Environment is correctly referenced, define the JRE_HOME environment variable as follows:

Console
export JRE_HOME=/opt/jdk1.8.0_161/jre

Next, append the JDK and JRE binaries to your system’s PATH variable:

Console
export PATH=$PATH:/opt/jdk1.8.0_161/bin:/opt/jdk1.8.0_161/jre/bin

Step 3: Install the Red5 Media Server

Download the latest stable release of Red5 from the official GitHub repository:

Console
cd ~
wget https://github.com/Red5/red5-server/releases/download/v1.0.9-RELEASE/red5-server-1.0.9-RELEASE.tar.gz

Extract the downloaded archive:

Code
tar xvzf red5-server-1.0.9-RELEASE.tar.gz

Rename the extracted directory to red5 and move into it:

Code
mv red5-server red5
cd red5

Start Red5 in the background using the command below:

Code
sh red5.sh &

Once running, you can access the Red5 welcome page by navigating to your server’s IP address on port :5080 using a web browser.

Step 4: Enable Red5 to Start on Boot

If you’d like Red5 to launch automatically when the server boots, begin by creating a new init script:

Console
sudo nano /etc/init.d/red5

Step 5: Add the Red5 Init Script

Insert the following content into the newly created /etc/init.d/red5 file. This script will control how the Red5 server starts, stops, and restarts:

Code
#!/bin/sh

### BEGIN INIT INFO
# Provides:             red5
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    Red5 server
### END INIT INFO

start() {
  cd /opt/red5 && nohup ./red5.sh > /dev/null 2>&1 &
  echo 'Service started' >&2
}

stop() {
  cd /opt/red5 && ./red5-shutdown.sh > /dev/null 2>&1 &
  echo 'Service stopped' >&2
}

case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
restart)
  stop
  start
  ;;
*)
  echo "Usage: $0 {start|stop|restart}"
esac

After adding the script, press Ctrl + O to save and Ctrl + X to exit the editor.

Step 6: Make the Script Executable

Set the correct permissions so the script can be executed:

Console
sudo chmod ugo+x /etc/init.d/red5

Step 7: Enable Red5 to Start on Boot

Install the sysv-rc-conf utility, which manages startup services:

Console
sudo apt-get install sysv-rc-conf

Then activate Red5’s automatic startup:

Console
sudo sysv-rc-conf red5 on

Step 8: Manage Red5 Using Service Commands

Now, you can easily control the Red5 server using standard service commands:

Console
sudo service red5 start
sudo service red5 stop
sudo service red5 restart

Final Step: Complete the Red5 Setup in Your Browser

To finish setting up Red5, open a web browser and go to:

http://[your-ip-address]:5080

Replace [your-ip-address] with the actual public IP address of your VPS. To access demo applications, navigate to:

http://[your-ip-address]:5080/installer/

Your Red5 media server is now fully installed and ready for use.

Conclusion

Setting up a Red5 Media Server on CentOS 7 involves several key steps—ranging from installing Java, configuring environment variables, and setting up the server itself, to enabling automatic startup via an init script. With everything in place, you can now leverage Red5's powerful media capabilities for live streaming, real-time data sharing, or testing its demo applications.

This setup provides a robust foundation for building interactive multimedia applications, all hosted on your own server environment. Be sure to explore Red5’s additional features and configurations as your project evolves.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren