Mihai Surdeanu

Setup a streaming audio server using Icecast and Ices

Today, we will continue the series of tutorials on IT domain by providing a short tutorial on helping you to setup a streaming audio server using Icecast on your own VPS.

There are only 15 steps to follow. Let’s start!

Step 1: The first step is to download all dependencies needed before actually trying to install Icecast:

dnf install compat-openssl10
dnf --enablerepo=PowerTools install libtheora-devel
dnf --enablerepo=PowerTools install speex-devel

Step 2: After having all dependencies installed, we can proceed with RPM package fownload for Icecast – version 2.4.4:

wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/i/icecast-2.4.4-1.el7.x86_64.rpm

Step 3: The next step is to continue with the installation:

rpm -i icecast-2.4.4-1.el7.x86_64.rpm

Step 4: Double check the installation status – ok or not ok? :

icecast -v

If everything works as expected, the output of the above command will be “Icecast 2.4.4” (without quotes).

Step 5: Build a custom configuration file to fill your needs based on the one from here. Follow all the comments from there to understand all properties. One example is also provided below (icecast.xml):


                <clients>5</clients> <!--represents number of clients allowed to connect in the same time-->
                <sources>1</sources> <!--represents the total number of sources allowed-->
                <threadpool>2</threadpool> <!--3 threads to handle all client requests-->


        <hostname>{YOUR_IP_ADDRESS}</hostname> <!--your server will be binded to a specific IP address-->
                <port>8000</port> <!--default port is 8000, but you can change it-->

                <basedir>/path/icecast</basedir> <!--location of your icecast installation-->
                <logdir>/log/icecast</logdir> <!--location of your logs directory-->
                <alias source="/" dest="/status.xsl"/>


                        <user>icecast</user> <!--run the process as icecast user and avoid running it as root!-->

Step 6: Start Icecast process in background:

icecast -b -c icecast.xml

Step 7: Now, you should be able to access the following URL from your browser: http://{YOUR_IP_ADDRESS}:8000. Demo: https://mihaisurdeanu.ro:8000/

Step 8: The next part of the tutorial is to configure a streaming client that will act as a generator. This component will be responsible for creating a streaming station and will deliver the content to end user. I’m going to deliver the content in OGG format. It’s recommended to use OGG instead of MP3 because this format is open source and is smaller in terms of size. Having all elements in mind, the best solution for this client is IceS.

Step 9: Other few dependencies are required as prerequisites for this client. One of them is libshout.

wget http://downloads.us.xiph.org/releases/libshout/libshout-2.3.1.tar.gz
tar xf libshout-2.3.1.tar.gz
cd libshout-2.3.1
./configure --prefix=/path/icecast
make install

Step 10: Now, we can continue with IceS compilation:

wget http://downloads.us.xiph.org/releases/ices/ices-2.0.2.tar.bz2
tar xf ices-2.0.2.tar.bz2
cd ices-2.0.2/
./configure --prefix=/path/icecast
make install

Step 11: IceS comes with his own configuration file (ices.xml). You can use as template:

        <background>1</background> <!--run as a daemon process-->


                        <name>RadioStation 1: Inspiring and Motivating</name>
                        <description>Compilation music for inspiring and motivating people.</description>
                        <param name="type">basic</param>
                        <param name="file">/path/icecast/playlist.txt</param> <!--next step is about playlist file-->
                        <param name="random">1</param> <!--select files randomly-->
                        <param name="once">0</param> <!--if value is 1, IceS will stop after running one time the entire content-->
                        <param name="restart-after-reread">1</param> <!--when playlist is changed, the list is loaded without restart-->

                                <nominal-bitrate>48000</nominal-bitrate> <!--48 Kbps-->
                                <channels>2</channels> <!--stereo-->

Step 12: Upload your media content in one directory: /path/location/to/media/. Make sure file extension is OGG and not MP3!

Step 13: Compute the playlist file:

find /path/location/to/media/ -name "*.ogg" > /path/icecast/playlist.txt

Step 14: Start IceS process in background, as another user:

su icecast
./ices ices.xml

Step 15: Start to listen your own music. Web interface: http://{YOUR_IP_ADDRESS}:8000.

That’s all. Good luck!


Pasionat de IT. Pasionat de viață. Pasionat de tot ceea ce înseamnă a face o viață mai bună, plină de înțelegere, ajutor reciproc și iubire de aproape.

Adaugă comentariu


Arhiva personală