Introduction

Red5 is an open-source media server designed for live video streaming, audio streaming, recording, and real-time communication. It supports protocols such as RTMP, WebSocket, and WebRTC, making it suitable for live streaming platforms, video conferencing, online education, and media broadcasting applications.

This guide explains how to install Red5 Media Server on a CentOS server.

System Requirements

  • Operating System: CentOS 7 / CentOS Stream
  • RAM: Minimum 2 GB (Recommended 4 GB+)
  • CPU: 2 vCPUs or higher
  • Java: OpenJDK 11 or later
  • Internet Connection
  • Root or sudo privileges

Step 1: Update the System

Update all installed packages.

sudo yum update -y

For CentOS Stream:

sudo dnf update -y

Step 2: Install Java

Install OpenJDK.

sudo yum install java-11-openjdk java-11-openjdk-devel -y

Verify installation:

java -version

Example Output:

openjdk version "11.0.x"
OpenJDK Runtime Environment
OpenJDK 64-Bit Server VM

Step 3: Create a Dedicated User

Create a non-root user for Red5.

sudo useradd red5
sudo passwd red5

Switch to the user.

su - red5

Step 4: Download Red5

Move to the home directory.

cd /home/red5

Download the latest Red5 release.

wget https://github.com/Red5/red5-server/releases/download/v1.3.37-M2/red5-server-1.3.37-M2-server.tar.gz

Step 5: Extract the Package

tar -xzf red5-server-1.3.37-M2-server.tar.gz

Rename the directory.

mv red5-server red5

Navigate into the installation directory.

cd red5

Step 6: Set Permissions

chmod +x red5.sh
chmod +x *.sh

Step 7: Start Red5 Server

Run the server.

./red5.sh

You should see output similar to:

Starting Red5...
Server started successfully.

Step 8: Verify the Service

Check whether Java is listening.

netstat -tulpn | grep java

or

ss -tulpn | grep java

Expected ports include:

5080
1935

Step 9: Configure Firewall

Allow Red5 ports.

sudo firewall-cmd --permanent --add-port=5080/tcp
sudo firewall-cmd --permanent --add-port=1935/tcp
sudo firewall-cmd --reload

Verify:

firewall-cmd --list-ports

Step 10: Access Red5 Web Interface

Open your browser.

http://SERVER-IP:5080

If everything is working correctly, the Red5 welcome page will appear.

Important Default Ports

Port Purpose
5080 Web Administration
1935 RTMP Streaming
8554 RTSP (Optional)
8081 WebSocket (Optional)

Running Red5 as a Systemd Service

Create a service file.

sudo vi /etc/systemd/system/red5.service

Add:

[Unit]
Description=Red5 Media Server
After=network.target

[Service]
Type=forking
User=red5
Group=red5
WorkingDirectory=/home/red5/red5
ExecStart=/home/red5/red5/red5.sh
Restart=always

[Install]
WantedBy=multi-user.target

Reload systemd.

sudo systemctl daemon-reload

Enable the service.

sudo systemctl enable red5

Start the service.

sudo systemctl start red5

Check status.

sudo systemctl status red5

Useful Commands

Start

sudo systemctl start red5

Stop

sudo systemctl stop red5

Restart

sudo systemctl restart red5

Status

sudo systemctl status red5

Logs

journalctl -u red5 -f

Troubleshooting

Java Not Found

Verify Java installation.

java -version

Install Java if missing.

Port Already in Use

Check which process is using the port.

ss -tulpn | grep 5080

or

lsof -i:5080

Firewall Blocking Access

Open the required ports.

firewall-cmd --permanent --add-port=5080/tcp
firewall-cmd --permanent --add-port=1935/tcp
firewall-cmd --reload

SELinux Issues

Temporarily disable SELinux for testing.

setenforce 0

To check the current status:

getenforce

Directory Structure

/home/red5/red5/
├── conf/
├── lib/
├── logs/
├── plugins/
├── webapps/
├── red5.sh
└── red5.bat

Security Recommendations

  • Use a dedicated non-root user.
  • Keep Java updated.
  • Restrict unnecessary ports.
  • Enable HTTPS using Nginx or Apache as a reverse proxy.
  • Monitor logs regularly.
  • Schedule backups of configuration files and media content.

Conclusion

Installing Red5 on CentOS is straightforward with the correct Java environment and firewall configuration. Running Red5 as a systemd service ensures automatic startup after reboots and easier management. Whether you’re building a live streaming platform, video conferencing solution, or media broadcasting application, Red5 provides a powerful and flexible open-source media server for real-time streaming.

Leave a Reply