Updated: 28 September 2026 · Applies to: Red5 open-source media server 2.0.46 with Java 21 on Ubuntu 24.04, Debian 13, AlmaLinux 9 or Rocky Linux 9 (with or without cPanel)
Red5 is an open-source media server written in Java. It receives and plays live streams over RTMP and serves video on demand. Older guides installed it through Apache Tomcat in cPanel's EasyApache and used Red5 1.0.7 with an init script. Current Red5 includes everything it needs and runs as its own service, so you do not need Tomcat or cPanel for it.
Before you start
- A VPS or dedicated server with
rootaccess. Red5 uses up to 1 GB of Java memory by default, so allow at least 2 GB RAM. - If the server also runs cPanel, Red5 can share it, but a separate VPS keeps your websites and streams apart.
- These ports free and open in the firewall: 1935 (RTMP) and 5080 (HTTP). Red5 also defines 5443 (HTTPS), 8443 (RTMPS) and 9999 (JMX) in
conf/red5.properties.
Install Red5
- Install Java 21.
On Ubuntu 24.04 or Debian 13:apt update apt install -y openjdk-21-jre-headless
On AlmaLinux or Rocky Linux:dnf install -y java-21-openjdk-headless
- Find the Java home folder and note the result:
dirname $(dirname $(readlink -f $(which java)))
- Download Red5 and unpack it to
/opt/red5:cd /opt curl -LO https://github.com/Red5/red5-server/releases/download/v2.0.46/red5-server-2.0.46.tar.gz tar xzf red5-server-2.0.46.tar.gz mv red5-server red5
- Create a user for Red5 so it does not run as
root:useradd -r -s /sbin/nologin -d /opt/red5 red5 chown -R red5:red5 /opt/red5
- Create the service file
/etc/systemd/system/red5.service, replacing theJAVA_HOMEvalue with the folder from step 2:[Unit] Description=Red5 media server After=network.target [Service] Type=simple User=red5 WorkingDirectory=/opt/red5 Environment=RED5_HOME=/opt/red5 Environment=JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 ExecStart=/opt/red5/red5.sh ExecStop=/opt/red5/red5-shutdown.sh Restart=on-failure [Install] WantedBy=multi-user.target
- Start Red5 and enable it at boot:
systemctl daemon-reload systemctl enable --now red5 systemctl status red5
- Open
http://SERVER-IP:5080in your browser. The Red5 start page confirms the server is running.
Open the firewall
With CSF, add 1935 and 5080 to TCP_IN in /etc/csf/csf.conf and run csf -ra. With firewalld:
firewall-cmd --permanent --add-port=1935/tcp --add-port=5080/tcp firewall-cmd --reload
Stream to Red5
In OBS Studio or another encoder, use the server address rtmp://SERVER-IP/live and any stream key, for example mystream. Players can then read the stream from the same address and key.
Change the memory limit
Red5 starts Java with a 1 GB heap. For more viewers, set your own options by adding a line such as Environment="JVM_OPTS=-Xms512m -Xmx4g" to the service file, then run systemctl daemon-reload and systemctl restart red5.
Troubleshooting
- "Please set JAVA_HOME" in
journalctl -u red5: theJAVA_HOMEline in the service file does not match the folder from step 2. - Port already in use: check with
ss -ltnp | grep -E ':1935|:5080', then stop the other program or change the ports in/opt/red5/conf/red5.properties. - Encoder cannot connect: make sure port 1935 is open in the server firewall and in any provider firewall.
Official source and releases: Red5 on GitHub.
Need a streaming server?
Our Red5 streaming servers start at $114 a month. For installation, tuning or SSL, you can hire an expert from $8 per 15 minutes.