How To Install A Streaming Audio Server With Icecast 2.3.3 On CentOS 6.3 x86_64 Linux

This tutorial explains creating your own streaming audio server with Icecast (OGG/MP3). Icecast was designed to stream any audio file if a appropiate streaming client is available. For OGG/Vorbis you can use ices and for MP3 icegenerator. Here is a small tutorial how to set up Icecast for streaming OGG/Vorbis and MP3.

This article contains the following topics:

Setting up the server: Icecast
Setting up the OGG/Vorbis streaming client: ices
Setting up the MP3 streaming client: icegenerator


Setting up the server: Icecast

First get the software:

# yum groupinstall "Development Tools"
# yum install -y curl-devel libtheora-devel libvorbis-devel libxslt-devel speex-devel libxslt
# rpm --import
# cd /home
# wget
# mkdir -p /usr/src/icecast
# cd /usr/src/icecast
# wget

Next extract the sources and change into the new driectory:

# tar xf icecast-2.3.3.tar.gz
# cd icecast-2.3.3

Then configure the sources:

# ./configure --prefix=/opt/icecast/2.3.3

And finally compile the sources and install the binaries:

# make
# make install

You should have now the icecast binary under /opt/icecast/2.3.3/latest/bin:

# ls /opt/icecast/2.3.3/bin/


Now go into the icecast directory and link the 2.3.3 directory to latest:

# cd /opt/icecast
# ln -s 2.3.3 latest

Now configure icecast by editing the icecast.xml file. First move the orignal sample file to an alternate place:

# cd /opt/icecast/latest/etc
# mv icecast.xml icecast.xml.orig
# vi icecast.xml

     <!-- LIMITS -->
     <!-- GENRIC -->
     <!-- PATHES -->
       <alias source="/" dest="/status.xsl"/>
     <!-- LOG -->
     <!-- SECURITY -->

The above icecast.xml is very simple. The first section LIMITS defines how many radio stations you maximum want to provide (sources=10), how many clients may connect (clients=100) etc.

The second section GENERIC defines a username, hostname MyHost/IP), port (8000) for the server itself etc.

The section PATHES defines the pathes to the webgui.

Icecast has a small and simple webgui to see what is going on and this section defines where to find the web documents.

The LOGGING section is of course for logging, where and what to log etc.

The SECURITY section defines that the Icecast software itself should run under the user icecast and the group icecast.

Now we need three more things to do: create a user and a group called icecast as defined in the icecast.xml configuration file, create the place for the logs and a place for the pid file.

First create the icecast user with the ID 200 and the group icecast with the ID 200:

# groupadd -g 200 icecast
# useradd -d /var/log/icecast -m -g icecast -s /bin/bash -u 200 icecast

With the -m option set the directory for the logs was automatically created and the second step can be spared. Only the directory for the pid file is now needed:

# mkdir -p /var/run/icecast
# chown -R icecast:icecast /var/run/icecast

Now give it a try and start the icecast server:

# /opt/icecast/latest/bin/icecast -c /opt/icecast/latest/etc/icecast.xml -b

Starting icecast2
Detaching from the console
Changed groupid to 200.
Changed userid to 200.

Your server is now running as your icecast user and logs will be produced under /var/log/icecast:

# ls /var/log/icecast/

access.log  error.log  playlist.log

Check that it is really running:

# pgrep -fl icecast

4434 /opt/icecast/latest/bin/icecast -c /opt/icecast/latest/etc/icecast.xml -b

Also the icecast server should be reachable via webgui under your given hostname and port, EG http://MyHost/IP:8000/, when you have setup one or more stations they will show up here. The user for the administrative webgui is defined in the icecast.xml file above - icecast. The password in this case is password.


Setting up the OGG/Vorbis streaming client: ices

Before you can compile ices you need the libshout library. First download it:

# cd /usr/src/icecast
# wget

Then extract the tar file and change into the new directory:

# tar xf libshout-2.3.1.tar.gz
# cd libshout-2.3.1

Run the configure script:

# ./configure --prefix=/opt/icecast/latest

And compile the sources and install the library:

# make
# make install

Now download the ices client:

# cd /usr/src/icecast
# wget

Extract the tar file and change into the new directory:

# tar xf ices-2.0.2.tar.bz2
# cd ices-2.0.2/

Before you run the configure script, export the PKG_CONFIG_PATH variable so ices will be able to include the libshout library:

# export PKG_CONFIG_PATH=/opt/icecast/latest/lib/pkgconfig:$PKG_CONFIG_PATH
# ./configure --prefix=/opt/icecast/latest

Now compile the sources and install the binaries:

# make
# make install

Check that the ices client is available:

# ls /opt/icecast/latest/bin/

icecast*  ices*

Finally configure the ices client and create your first OGG/Vorbis radio station:

# cd /opt/icecast/latest/etc/
# vi ices1.xml

     <!-- GENERIC -->
     <!-- LOGGING -->
     <!-- STREAM -->
         <name>RadioStation 1: OGG</name>
         <description>Test Radio 1</description>
         <param name="type">basic</param>
         <param name="file">/opt/icecast/latest/etc/playlist1.txt</param>
         <param name="random">1</param>
         <param name="once">0</param>
         <param name="restart-after-reread">1</param>

The ices configuration file is as easy as the icecast configuration file. The section GENERIC defines to run ices in background and where the pid file can be found.

The section LOGGING is all about logging, where and what to log. The STREAM section needs a little more attention. It defines the radio station itself like the name of the station, where the icecast server can be reached etc.

The password is the source password from the icecast configuration file. If you don't set a password here everybody can connect to your icecast server and create a station.

One more thing: the playlist. The playlist is a plain text file and contains all your songs you want to play.

Every OGG/Vorbis file inside this file must have the full path, eg:

# cd /opt/icecast/latest/etc/
# vi playlist1.txt


You can create this list easily with find:

# find /music/artist/album/ -name "*.ogg" > /opt/icecast/latest/etc/playlist1.txt

With the ices configuration file and the playlist created, start up ices as user icecast:

# su - icecast -c "/opt/icecast/latest/bin/ices /opt/icecast/latest/etc/ices1.xml"

Now take a look into the log file:

# cat /var/log/icecast/ices1.log

[2011-12-16  12:17:05] INFO signals/signal_usr1_handler Metadata update requested
[2011-12-16  12:17:05] INFO playlist-basic/playlist_basic_get_next_filename Loading playlist from file "/opt/icecast/latest/etc/playlist1.txt"
[2011-12-16  12:17:05] INFO playlist-builtin/playlist_read Currently playing "/music/artist/album/song2.ogg"
[2011-12-16  12:17:05] INFO stream/ices_instance_stream Connected to server: MyHost/IP:8000/radiostation1

As you can see the first radio station is ready and available under http://MyHost/IP:8000/radiostation1

Now try to connect to your streaming server with an audio client and enjoy listening to your radio.

For each radio station you want to provide you need to create a single ices configuration file with it's own playlist etc. Eg. you can create a seperate radio station for your Rock music and a seperate radio station for your Pop music.


Setting up the MP3 streaming client: icegenerator

To stream MP3 files you need a streaming client like icegenerator. Before you can compile icegenerator you have to install libshout first.

# cd /usr/src/icecast
# wget

Then extract the tar file and change into the new directory:

# tar xf libshout-2.3.1.tar.gz
# cd libshout-2.3.1

Run the configure script:

# ./configure --prefix=/opt/icecast/latest

And compile the sources and install the library:

# make
# make install

To compile icegenerator download the source package from and store it in your src directory. Then go into the src directory and extract the source:

# cd /usr/src/icecast
# wget
# tar xfz icegenerator-0.5.5-pre2.tar.gz
# cd icegenerator-0.5.5-pre2

Now run the configure script (the --prefix option will be ignored, just run the configure script without the --prefix option):

# ./configure

And compile the sources and install the binaries:

# make
# make install

Check that icegenerator is available:

# ls -lah /usr/local/bin/ice*

-rwxr-xr-x 1 root root 55K 2011-12-16 12:41 /usr/local/bin/icegenerator*

Now configure icegenerator and create your first MP3 radio station:

# cd /usr/local/etc
# vi icegen1.cfg

NAME=RadioStation 2: MP3

The configuration file is a bit more complicated than the ices configuration file.At first you to define the IP and port for your Icecast server.The SERVER option is for the icy or http protocol, here it is http. MOUNT and PASSWORD are same as the OGG/Vorbis station, where to reach the station itself (http://MyHost/IP:8000/radiostation2) and how to authenticate.The FORMAT option is for either streaming MP3 (1) or OGG/Vorbis (0). LOOP and SHUFFLE for looping the playlist and randomized plaing. NAME, DESCRIPTION and GENRE will describe your radio.MP3PATH defines which files to stream, in this case all from a m3u compatible playlist (created later).URL tells where to reach the streaming server or any other address. This address will maybe displayed by your player. Specifiy LOG and LOGPATH for logging.The BITRATE defines the streaming quality..

# vi /usr/local/etc/playlist2.m3u


# find /music/artist/album/ -name "*.mp3" > /usr/local/etc/playlist2.m3u

# su - icecast -c "export LD_LIBRARY_PATH=/opt/icecast/latest/lib:$LD_LIBRARY_PATH; /usr/local/bin/icegenerator -f /usr/local/etc/icegen1.cfg"

# pgrep -fl icegen

31255 icegenerator -f /usr/local/etc/icegen1.cfg

# cat /var/log/icecast/icegen1.log

Fri Dec 16 13:44:38 2011: Connected to stream serverFri Dec 16 13:44:38 2011: Now playing song1.mp3Fri Dec 16 13:48:41 2011: Wait for all child process to terminate......

As you can see the second radio station is ready and available under http://MyHost/IP:8000/radiostation2

Now try to connect to your streaming server with an audio client and enjoy listening to your radio.


Icecast, libshout and ices:
Description for icegenerator:

Share this page:

16 Comment(s)

Add comment


From: Anonymous


make install

on RPM based distro its very bad idea.

search icecast and install rpm 

From: TBR

Please note that compiling Icecast from source is largely unnecessary. Most distributions carry an Icecast package, also in the case of RHEL/CentOS. It's called EPEL:

From: Cristian Rodriguez

How can i restart icecast in this case if it is not a service

From: Anonymous

su - icecast -c "/usr/local/bin/icegenerator -f /usr/local/etc/icegen1.cfg" Source drops when using this: su - icecast -c "export LD_LIBRARY_PATH=/opt/icecast/latest/lib:$LD_LIBRARY_PATH; /usr/local/bin/icegenerator -f /usr/local/etc/icegen1.cfg"

From: Diable

How to make that icegenerator run forever ?

I ask that because for me it stops after some times.

From: Paul

Does anybody know if its possible to reload icegenerator with a new playlist?

I do not want to restart icegenerator so the stream would stop.

Thanks in advance.



A couple of install notes:

icecast2 is now 2.4.0

rpmforge is now

This is by far the most cleanest guide for getting icecast started. Thank you very much!!



From: Diego

It's a very nice guide, thank you!

 But its missing something very important!

How to starts icecast when system power up, and how to start icegen (for mp3 stream) too.

It's simple and usefull. So let's go.

 1) Create a init script:
nano /etc/init.d/icecast

2) Paste the code:

3) Set permission to init.d icecast file:
chmod +x /etc/init.d/icecast

4) Set permission to root (or another user - change the root) to use the command:
gpasswd -a root icecast

5) Check icecast status:
service icecast status
PS: This check only icecast, not icegen. But if you use start, stop or restart the command will works with icegen too.


Check icecast is running:
service icecast status

Start icecast and icegenerator:
service icecast start

Stop icecast and icegenerator:
service icecast stop

Restart icecast and icegenerator:
service icecast restart

I hope that it's usefull for you!


I've added another usefull simple command to upload your playlist with all mp3s in one folder:

1) Upgrade your /etc/init.d/icecast for the new @

2) Change mp3's dir to yours in the line: MP3DIR=/home/mp3s/

3) Now just upload the mp3s to your server and use the command to update the mp3playlist:
service icecast reload

PS: This will stop your icecast service, upload the playlist and starts again. So it will take your station down for a short time.

From: Alex Hughes

If anyone has a problem configurating icegenerator (I had) just try adding the following params in the ./configure command: ./configure --with-shout=/opt/icecast/latest/ Other than that, perfect and clean guide.

From: OMG

I have the biggest migraine headache from reading this.

From: Anonymous


It was all going well till I unwittingly installed the OGG/Vorbis streaming client: ices.  Now I want to remove everything I have done in this tutorial and start over.  Any suggestions?

From: kaburu

I have followed this tutorial well but now my stream has no sound. It is showing the progress of the song on clients but no sound

From: Jeff

Are there any good instructions for setting up Icecast to use port 80, (securuty settings, etc)?  I've found some for Debian but nothing for CentOS

From: Leo

June, 1 2016

Installed icecast 2.4.3 using this guide and got the icecast server to run according to the "pgrep -fl icecast" command. Unfortunately I cannot reach the icecast webgui from either the domain url:8000/admin/ or the IP:8000/admin/ .

What gives?

From: Paul

This (init / stop / reload) script code runs on CentOS 6.5 x86_64 (the executable paths and configuration file have been modified for this particular manual)



#!/bin/bash # # icecast      This shell script takes care of starting and stopping #              the icecast multimedia streaming systen. # # chkconfig: - 85 15 # description: icecast is a multimedia streaming daemon. It is used to \ #              relay and offer multimedia streaming content. # processname: icecast # pidfile: /var/run/icecast/ # config: /opt/icecast/latest/etc/icecast.xml

 # Source function library. . /etc/rc.d/init.d/functions [ -x /opt/icecast/latest/bin/icecast ] || exit 0

 # See how we were called. case "$1" in   start)         # Start daemon.         echo -n $"Iniciando icecast: "         daemon "/opt/icecast/latest/bin/icecast -c  /opt/icecast/latest/etc/icecast.xml -b > /dev/null"         RETVAL=$?         echo         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/icecast         ;;   stop)         # Stop daemon.         echo -n $"Deteniendo icecast: "         killproc icecast         RETVAL=$?         echo         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icecast         ;;   status)         status icecast         RETVAL=$?         ;;   restart)         $0 stop         $0 start         ;;   reload)         echo -n $"Reiniciando icecast: "         killproc icecast -HUP         RETVAL=$?         echo         ;;   condrestart)         [ -f /var/lock/subsys/icecast ] && restart || :         ;;   *)         echo $"Use: $0 {start|stop|status|restart|reload}"         RETVAL=1         ;; esac exit $RETVAL