WSBF Engineering: Build a dedicated Icecast2 server... from scratch

First off, I should note that I worked this past week with David A. Cohen to make this happen. It's really not a difficult install (once you know what you're doing) so I thought I'd write up a quick and dirty HOWTO for this week, so you can do it too!

What this guide assumes

  • You have a single source of digital audio already set up
    • We use darkice on another dedicated server to transcode from analog to digital audio.
    • This is material ripe for another tutorial... soon!
  • The computer that you're using for this is reasonably new.
    • We used an old Dell Precision... Intel Xeon 3.00GHz, 4 GB of RAM, Gigabit Ethernet card
  • You have at least one port (traditionally 8000) open to the greater Internet.
    • If you're on a home network, this is 'port forwarding' on your router.
    • If you're on a campus/etc., contact your IT department.
    • A static IP for this computer is helpful, though it is not required. Otherwise, use a Dynamic DNS service.

You are starting with a single, blank hard drive.
This guide does not cover dual booting or anything annoying like that.

So... here we go.

1) Install Ubuntu. We HIGHLY recommend the newest server edition. For our box, it is Ubuntu Server 10.04.2 LTS 64-bit. Follow the standard installations and don't do anything out of the ordinary. Configure DHCP Ethernet automatically; re-format the entire hard drive.

2) At WSBF, our servers are in a locked closet, and it behooves us to have remote access. Therefore:
$ sudo apt-get install openssh-server
Now you can log in remotely via ssh.

3) Now you need icecast2. Get on it!
$ sudo apt-get install icecast2

4) Set the bare minimum of settings in the main configuration file. (Use your favorite editor.)
$ sudo vi /etc/icecast2/icecast.xml

  • We set <clients> to 675 - this is close to the theoretical max supported by gigabit ethernet.
  • We set <sources> to 6 - this is a maximum, and sometimes we have weird remote broadcasts going on.
  • Change ALL the passwords: <source-password>, <relay-password>, <admin-password>
  • Setting <hostname> is important if you use the icecast2 HTTP server for status checking - ours is stream.wsbf.net
  • Change the <port> if you're not using 8000 - the usual icecast2 port.

5) Allow icecast2 to run. This is a security feature so you don't accidentally leave an unsecured server running.
$ sudo vi /etc/default/icecast2
Change ENABLE=false to true.

6) Start that server!
$ sudo service icecast2 start
If you restart the computer later, icecast2 will start automatically. However, you may need to restart your audio source when icecast2 goes down.

This guide worked for WSBF after we removed a failed SCSI drive from the system, but that's for another blog post. Hopefully this guide will be of use to you in your travels. Remember, radio wants to be free, and so should you. Happy hacking!