DIY internet radio: Part one (CentOS and Icecast)

A January 1924 photograph of a radio enthusiast on snow shoes equipped with a radio set and a coil aerial, in order not to miss the ski route. Setting up an “internet radio” service (webcasting) is something I’ve been interested in doing for awhile. This weekend, I thought I’d give it a go, and I managed to set up a simple streaming service on my CentOS box within a couple of hours.

The first thing any DIY webcaster will need is software to stream their media. I chose Icecast, an open source audio streaming service. It is similar in functionality to the proprietary media server program SHOUTcast by Nullsoft.

Installing and configuring Icecast is relatively straightforward. To determine the latest version and the path to the latest version of Icecast, navigate to For the purpose of this tutorial, I used version 2.3.3, located at The documentation for version 2.3.3 is located at

According to the documentation, Icecast requires the following packages:

  • libxml2
  • libxslt
  • curo
  • ogg/vorbis

In order to build Icecast, you’ll need the “devel” RPM packages.


To install Icecast, ssh into your CentOS box.

First, install the Icecast dependencies by running the following:

yum install curl-devel libtheora-devel libvorbis-devel libxslt-devel speex-devel

Once the dependencies are installed, create a new working directory somewhere (I created wd off the root):

cd /
mkdir wd
cd wd

Then, get the Icecast source, uncompress it and move into the extracted directory:

tar -xvzf icecast-2.3.3.tar.gz
cd icecast-2.3.3

Configure the source. I followed the instructions at sachinlinux, but you can put the various files wherever you prefer:

./configure --sysconfdir=/etc/icecast --prefix=/usr --exec-prefix=/usr --datadir=/usr/share

This configuration will put the executable in /usr/bin, the configuration file in /etc/icecast and the web root and documentation under /usr/share/icecast.

Once Icecast is configured:

make install


Icecast should now be installed. Prior to starting the service, it will need to be configured. Locate the default icecast.xml. If you configured the source using the options I did, it can be edited using the following:

vi /etc/icecast/icecast.xml

The default icecast.xml should look like this.

Important changes that should be made:

  • Locate the <authentication> section and update the passwords:
    • The username for sources is “source,” but update the <source-password> to something other than “hackme.”
    • The username for relays is “relay,” but update the <relay-password> to something tother than “hackme.”
    • I changed both the <admin-user> name and the <admin-password>.
  • I updated the <hostname> to the URL I set up for my “station.” I left the default port as 8000.
  • Most of the paths in the <paths> should be correctly set from the configuration variables passed to make. However, I changed the <logdir> to /var/log/icecast.
  • In the <security> section, uncomment the <changeowever> section. Change the <user> to “icecast” and the <group> to “icecast.”

Some of the less important changes I made include:

  • <location> is an arbitrary string visible on the server info page. I set it to my physical location.
  • <admin> is another arbitrary string visible on the server. I set mine to an email address I set up for the station.
  • I left <clients> at the default 100, but changed <sources> to 1. Sources controls the number of “channels” available on your station.

Final steps

The <logdir> path I specified in the icecast.xml needs to be created:

mkdir /var/log/icecast

Icecast will be run by the icecast user in the icecast group, but this user doesn’t exist yet:

useradd icecast
chown icecast:icecast /var/log/icecast

Now Icecast can be started:

icecast -c /etc/icecast/icecast.xml -b

The c flag should be the path to the config file and the b flag tells Icecast to run in the background.

The following should output:

Starting icecast2
Detaching from the console
Changed groupid to …
Changed userid to …

To verify it’s running, you can check the error.log. You should see:

INFO main/main icecast server started

You should also be able to navigate to the URL and port you specified in icecast.xml. A basic authentication box will appear, asking for the admin username and password (also specified in the icecast.xml).


In part one, we’ve installed and configured Icecast, a streaming media server, on a CentOS box. However, we don’t have a station yet. Icecast will stream an audio file if an appropriate streaming client is available. There are a couple of options here, and I’ll cover clients in part two.

If you’d like to see a different tutorial on installing Icecast, I recommend:

If you have any questions, comments and/or concerns, please leave a comment below. Thanks!

2 thoughts on “DIY internet radio: Part one (CentOS and Icecast)

Leave a Reply