How To Install RED5 Server on Centos 5.3

on August 16 | in Hosting / Servers, Linux | by | with 482 Comments

In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 – 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc.

1) Download and Install Java

RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

2) Download and Install Ant & Ivy (Apache Project)

Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.

cd /usr/src
tar jxvf apache-ant-1.8.2-bin.tar.bz2
mv apache-ant-1.8.2 /usr/local/ant

cd /usr/src
svn co ivy
cd ivy
ant jar
cp build/artifact/jars/ivy.jar /usr/local/ant/lib/

3) Export Variables for Ant and Java

export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin

Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.

echo ‘export ANT_HOME=/usr/local/ant’ >> /etc/bashrc
echo ‘export JAVA_HOME=/usr/lib/jvm/java’ >> /etc/bashrc
echo ‘export PATH=$PATH:/usr/local/ant/bin’ >> /etc/bashrc

4) Download and Install RED5 Server

Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.

cd /usr/src
svn checkout red5
mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist

you will see a ton of lines, but you should get at last


that’s mean its install and now copy the conf directory from dist/ and test the red5 installation.

cp -r dist/conf .

If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.

5) Init Script

Now we will create init script for red5 to start, stop and restart easily.

vi /etc/init.d/red5

download and copy / paste code in it. The init script code also be viewed below.

# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5


# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5


case “$1″ in
echo -n $”Starting $PROG: ”
$DAEMON >/dev/null 2>/dev/null &
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG

[ $RETVAL -eq 0 ] && success $”$PROG startup” || failure $”$PROG startup”
echo -n $”Shutting down $PROG: ”
killproc -p $PIDFILE
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
$0 stop
$0 start
status $PROG -p $PIDFILE
echo $”Usage: $0 {start|stop|restart|status}”

exit $RETVAL

Enable executable permission

chmod +x /etc/init.d/red5

Now start the service

/etc/init.d/red5 start

check status

/etc/init.d/red5 status
red5 (pid  XXXXX) is running…

again you can do stop, restart.

6) Test

Now test the RED5 installation by opening following URL in browser


you will see red5 page like this


and demos can be find here.



You can use simple port tester tool that determines which ports the Flash Player is able to connect through to the Red5 server. Put your server address or IP in HOST when using port tester. You should get SUCCESS on RTMP or port 1935. If not please check your firewall.




When you run ./, it will show you Installer service created. Thats mean everything runs fine and red5 server is up. But if you went to port_tester.swf using demos above or your application shows connections FAILS, this is an issue of RTMPT and RTMPTS. You can see it by running


output trancated

[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPT server bean was not found
[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPS server bean was not found

output truncated

If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in/usr/local/red5/conf/red5-core.xml

vi /usr/local/red5/conf/red5-core.xml

Search for a lines

<!– RTMPT –>
<bean id=”rtmpt.server” class=”” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Same goes for RTMPS

<!– RTMPS –>
<bean id=”rtmps.server” class=”” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Restart the red5 services and connection fails problem will be fixed.

If you any question please use comments.

pixelstats trackingpixel
Pin It

related posts

482 Responses to How To Install RED5 Server on Centos 5.3

  1. Mathieu says:

    This is an new error when i am trying to execute ant prepare: Could not load definitions from resource org/apache/ivy/ant/antlib.xml….

    any idea ?

  2. Franck says:

    Its work fine for me!

    Thank You!!!!!!

  3. Leo Baker says:

    Hello Dean,

    I have finally got Red5 working, but how do I set the username and password to connect to the port 5080: admin panel for red5?

    My other question is how do I setup Flow player to grab a rtmp stream from my folder and play it on a webpage?

    And where shall I upload new files to the webapps, ofldemo, streams?



  4. […] Reference:, […]

  5. Alian says:

    I install followed your instructions except instead of checkout via svn;
    Red5 has been running up. But I cannot access via http://server_domain:5080/ or http://server_ip:5080;
    Is there something I should do?
    Some information:
    OS: CentOS Linux 5.4
    netstat -lnp | grep java
    tcp 0 0* LISTEN 25907/java
    tcp 0 0* LISTEN 25907/java
    tcp 0 0* LISTEN 25907/java
    tcp 0 0* LISTEN 23373/java
    tcp 0 0* LISTEN 25907/java
    tcp 0 0* LISTEN 25907/java
    Thanks a lot.

  6. Alian says:

    I know, I should open the ports :1935,9999,55857,5080; Some other ones help me, so I am ok now. Thanks for you
    instructions. Thank you.

  7. XXX says:

    I I met the same problem and Alian,please help me,how can i the ports:1935,9999,5857,5080,or do other.Thank you.

  8. Dean says:

    @ XXX

    Please read the previous posts. I have mentioned how to do this a few times now.

    But to help you, read this or follow the link.

    You must edit IPtables in your control panel. Eg, through WHM, Pleask, Webadmin.

    If you are not using a control panel, you must edit them manually. Follow the above link to explain how to do it or try the following,

    vi /etc/sysconfig/iptables

    Add the following lines:

    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5080 -j ACCEPT

    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1935 -j ACCEPT

    Then save the file (press ESC and then type :wq)


    /etc/init.d/iptables restart


    the line starts with “-A” and ends with “ACCEPT”

    The lines have been wrapped in this post.

  9. XXX says:

    @ Dean,
    Thank you very much!!!!!
    I am ok with you help now,^wholehearted^!!

  10. cafeolai says:

    I successfully installed red5 server on centos 5 . all demos work fine, the only problem I have is that localhost is not conneting, i have to enter the server ip address for the demo to work.
    any idea please ?
    also, I am trying to install red5 recorder but I am struggling. have you got instructions how to install it please?
    Thanks a lot for your help. 🙂

  11. Dean says:


    If you are ruinning red5 on a remote server, you have to use the server IP. NOT localhost.

    Only use localhost if you are installing on a local server and accesing red5 from that server.

    I have never installed recorder so I cant help you there. Sorry.

  12. sam says:

    I install it and i can see java use port 1935 but mydoin:5080 dont work firefox said cant connect
    and also in /usr/local/red5/conf/red5-core.xml I dont see


    and RTMPTS
    to uncomment it
    plz plz help me
    thanks alot

  13. XXX says:

    Hi Dean & All,
    I need to you,I have sucessfully install red5 server with you help.and i install one application in ‘/webapps/’,I can successfully access “http://ip:5080/messenger7”.
    now,i want to access “http://domain name/messenger7”,but i must be add port number. e.g. “http://domain name:5080/messenger7”.how can i do,disuse port number.with the domain name will be able to access the application.e.g.”http://domain name/messenger7″
    Hope everyone can help me….thanks……

  14. Dean says:

    Hi XXX

    You have only installed a webapp in red5. This is the back end of red5. It like the circuit board in your mobile phone. It runs the phone, you just use the buttons on the front to control it.

    A URL such as
    is is telling the user to assess a folder on your sever called messenger7 and not the folder in your back end of red5.

    You will need to write a front end to access the back end.

    To do this, simply create an index.html on your http server. When you log into your http server via FTP you should have a “public_html” folder. In this folder creat a messenger7 folder and in the messenger7 folder, create a html file that embeds your red5 application in it.

    You will be able to get the code needed to create the html file from the html file located in the messenger7 webapp folder.

    Hope this helps.



  15. Dean says:

    @ Sam,

    Your problem has been answered here already, please read through the previous posts on how to open ports.

  16. XXX says:

    Hi Dean,
    Thank you with you help……..I am trying to create controller for this ……thanks….
    Best Regards,

  17. Maurice says:

    I have an issue, I install red5 for a customer and now it get a “red5 dead but pid file exist”, when i view status….where can I check logs to fix issue. Im on plesk, linux, centos 5.x+

  18. jon says:

    How about this error:

    Exception in thread “main” java.lang.ClassFormatError: org.red5.server.Bootstrap (unrecognized class file version)
    at java.lang.VMClassLoader.defineClass(
    at java.lang.ClassLoader.defineClass(
    at java.lang.ClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(

  19. jon says:

    Wrong java version! fixed it.

  20. mepine says:


    Thank you for your tutorial, I get my red5 running (probably) following this guide, although I’m a newbie for linux/centos/red5.

    However, I cannot open it on browser, with ALTHOUGH I can see it says “red5 (pid 3529) is running…”.

    I got 2 different results following you steps, they are probably the problems…

    One is: I cannot find under $JAVA_HOME/lib/, but I can get my java is 1.6.0_17, so I just didn’t add it to $CLASSPATH.

    The other is: I didn’t get “Installer service created” but a “Bootstrap complete” but I think it’s just changed since I might get a newer version and the Red5 seems running actually from the command line so I didn’t mind it.

    I got same results with you in other steps, except for the browser testing…

    So do you have any idea of where the problem could be? Or how can I find the problem?

    Thanks very much.


  21. @mepine: Kindly change to your server IP address, meant you are accessing your own PC. To get the Red5 site, put the IP on which you install Red5.


  22. mepine says:


    Thank you for the replying. But yes… this is the virtual machine where I install the red5 server… I cannot either access it from the mac using 192.168.blahblah or access the server in the machine itself using That’s why I feel so strange.


  23. James M says:

    I’m facing similar issue to mepine above – fully installed as instructed, got the bootstrap complete message – but now when I access REMOTEIP:5080 nothing opens, I’ve also disabled iptables to see if it were a firewall issue but it is not.

    However it does say RED5 is operating when executing the status command.

  24. PanaClips says:

    I’ve installed it succesfully, but I’m running CENTOS 5.5 x86_64 standard on WHM 11.26.20, I’ve installed it thru console and everything worked ok… Now how can I know in which of the 10 ips I have in my dedicated server is? I tried the main IP Address and it was not there…

    The last good thing I did according to this tutorial was:
    # /etc/init.d/red5 status

    And it returned: “red5 (pid 5528) is running…”

    What should I do now?

    Great tutorial BTW!


  25. @PanaClips: Kindly find following command to check your IP connected with red5,
    #netstat -anpt | grep java
    If you get for 1935 port then its all IPs which you can use for Red5 either it will give you some specific IP. Between its bydefault for all installations.

  26. Ali says:

    Thank you for your tutorial, I’ve tried to do installation but I have a problem for setting up of RED5 and Appache Ant.

    My problem is that I have a apache already on my host and I couldn’t remove Apache so how can I configure Apache Ant on it?


  27. ImpY says:

    Hey thanks for this tutorial. I’ve done everything step by step and it works fine, till I create the ‘etc/init.d/red’ – Script.
    When I start the script /etc/init.d/red5 start I got those errormessage:

    stop: missing job name
    Try `stop –help’ for more information.
    /etc/init.d/red5: Zeile 49: status}”: command cannot found
    restart: missing job name
    Try `restart –help’ for more information.

    May someone can help me?

  28. Mark says:


    Did you copy and paste the above text into your /init.d/red5 file?

    If so the problem is characters not being copied correctly.

  29. Burim says:

    when i tray to start the red 5 i see the following error

    /root$ /usr/local/red5/
    Running on Linux
    Exception in thread “main” java.lang.NoClassDefFoundError: org/red5/server/Bootstrap
    Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    Starting Red5
    at java.lang.ClassLoader.loadClassInternal(
    Could not find the main class: org.red5.server.Bootstrap. Program will exit

    and i can not kreate the script to start and stop red 5
    please help

  30. spoo says:

    Hi, i have the same issue like Maurice

    Red5 start, but when you check with –status ,
    return, Red5 dead but pid file exist

    Any idea

    thank for this great tuto

  31. Dean says:

    Seems to me you have an incompatible version of Java.
    You might need to update your version of java for your version of Centos.

  32. af says:

    Hi —
    When I run: /etc/init.d/red5 restart, I see:
    [INFO] [Launcher:/installer] org.red5.server.service.Installer – Installer service created

    But when I navigate to http://myIP:5080 I can not connect.

    I also see this when I start red5:[INFO] [main] org.red5.server.tomcat.TomcatLoader – Dedicated RTMPT server configuration was not specified
    [INFO] [main] org.red5.server.tomcat.TomcatLoader – Dedicated RTMPS server configuration was not specified

    Can anyone take a guess as to what the problem may be?


  33. newman says:


    Thank you for this tuto. I have the same problem like many peaople. All installation is ok . i start /etc/init.d/red5 start.
    But i can log in to http://myip:5080/
    when i put :
    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5080 -j ACCEPT

    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1935 -j ACCEPT

    i have :
    /etc/init.d/iptables start
    Flushing firewall rules: [ OK ]
    Setting chains to policy ACCEPT: filter [ OK ]
    Unloading iptables modules: [ OK ]
    Applying iptables firewall rules: iptables-restore: line 7 failed

    this is my iptables :

    # Firewall configuration written by system-config-securitylevel
    # Manual customization of this file is not recommended.
    :INPUT ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5080 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1935 -j ACCEPT

  34. Dean says:

    @ newman

    I have mentioned how to correctly open ports a few times here now. If you read my post (about 18 posts back) it should help you.



  35. Reynold P J says:

    Hi Dean,

    First of all thanks for this wonderful post:)
    It would be great if you could explain about the admin panel of red5.

    I tried to access the default admin panel that comes along with red5 installation. The admin panel gives the following error when i try to login

    I have checked the firewall rules, and they are opened. If you have any idea, please help.

    Thanks in advance.

  36. Leo says:

    I am on Cent os 5.5 64bit, I have red5 running, when I am playingback flv files, I am getting Pink blocking, and the audio sounds like it is under water then my stream can cut off. I am on a dual core server with 2gb of ram. The file I am trying to play are the smaple flvs which came withthe install the avatar and avatar vp6 as well as my own which are 640×360 flv from Sorenson media using the flash 8 stremaing preset.

    I am using the 0.9.1. Has anyone had this problem before with the pink blcoking like distorted video then image?



  37. Please help me dean

    I have successfully installed red5 0.8.0….
    i am getting successfully my home page by entering the http://myip:5080 but after that..i am confuse how can i add some videos and audio ……mean what should i do on Linux server for using this….

    mean i am unable to identify the how can i use this application for my site like…

    thanks in advanced….

    Send me some suggestion on my mail id

  38. veo says:

    thanks for info. really nice tutorial..i’ m a newby to linux + bear with me.
    installed server..its up n running..oh how do i staart it at boot time?
    is it entailed in the provided script?
    ? (1) do i put vidz in oflademo/stream folder?
    (2) how to access via web?
    (3)are there steps i can follow so i gain access via the web..?
    i appreciate help greatly..
    thanksz again..

  39. Leo says:

    Hello Veo,

    To start as boot time put into SSH this command

    /etc/init.d/red5 start

    1. You can use Winscp and then login with your user/root password and you will be able to add more videos into the oflademo folder.


    2 and 3 I am not sure, do oyu mean how to stream video into a player such as Longtail/JW and Flowplayer via rtmp?

  40. veo says:

    hello alll
    having followed setup from above post…for red5 i see this error at login..
    did i do someting wrong?
    how do i fix it?
    what is the syntax when using client to play file from server?
    which player is recommended(4 pc)?

    thanks 4 ur help
    Last login: Fri Dec 24 21:50:43 2010 from 172.16….
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found
    -bash: ‘export: command not found

  41. @veo, I had the same message, for me this was due to the fact that I copied the lines of code directly from this page. This copies the ‘ and ’ as a special character.

    Just “vi /etc/bashrc”
    and remove the offending lines.

    Copy the code form the page to a html/text editor, make sure you replace all the ‘ and ’ with ‘ and try again.

    Hope this helps.


  42. frank says:

    I have the same issue as newman, after updating iptables as per your code I get the following:
    [/usr/local/red5/conf]# /etc/init.d/iptables restart
    Flushing firewall rules: [ OK ]
    Setting chains to policy ACCEPT: mangle filter nat [ OK ]
    Unloading iptables modules: [ OK ]
    Applying iptables firewall rules: Bad argument `NEW’
    Error occurred at line: 17
    Try `iptables-restore -h’ or ‘iptables-restore –help’ for more information.

    any additional help would be greatly appreciated, as I have read through the comments thank you

  43. frank says:

    ^ sorry for the double comment.
    I have gotten the ports to listen and port_tester.html shows SUCCESS for RTMP Default and 1935. However, after registering a new admin user and pw I get the following error when attempting to connect:

    I see that Reynold PJ is having the same issue I am on. thanks again Dean.

  44. […] How To Install RED5 Server on Centos 5.4 In this how to i will describe how to install RED5 server on Centos 5.4.x This how to can be used to install RED5 server on Centos 4 and Fedora 8 – 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc. […]

  45. kevin says:

    For those of you that get demo page but the demos don’t actually connect. And you are using the right ip and it still doesn’t work.

    Goto install demo. Install ofla demo even if its already installed. Something about this corrects the issue. everytime I install with these instructions I seem to have to do that. Don’t know why.

    Hope that helps.

  46. Dean says:

    ofla demo is not actuve by default. You MUST install in is after setting up red5 for the 1st time.
    This applies to all demo apps that come with red5.

  47. Dean says:

    Stupid fingers can’t type today.. Correction,

    ofla demo is not active by default. You MUST install it after setting up/installing red5 for the 1st time.
    This applies to all demo apps that come with red5.

  48. Ralph says:

    Hi everybody,

    @Reynold P J and everybody else: I cannot access the admin panel . It says NetConnection.Connect.Closed . Everything else works. Tried it on different remote machines, with both 0.9. and 1.0 version. No firewall installed. Very frustrating after 3 full days googling etc . Any help highly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *

« »