How to setup an Icecast streaming server

An up to date (as of March 2020), comprehensive yet easy to follow, step by step guide to setting up an Icecast streaming server for your internet radio station, complete with some free stream hosting to test it with!

This Icecast Setup Guide covers everything you need to know and all you need to do

It even comes with a Bandwidth Calculator and Mountpoint Configuration Tool to make it easier!



Does your internet radio streaming provider:

  • Limit how many listeners you can have at any one time?
  • Limit your audio quality to a low bitrate?
  • Charge you every month for these limits?
  • Want you to pay more to remove them?
  • Cost more than $6.00 + taxes each month?

If you answered yes to the above, isn't it time you started running your own streaming server?

Open up to the freedom of being in charge of the audio quality you broadcast and how many listeners can tune into your stream.

What you need:

Let's get started. Besides a coffee and a clear schedule, there are two things you need to get the signal from your radio station into the ears of listeners through the web:

1) Icecast: the streaming server software



Reference: https://icecast.org/

"Icecast is a streaming media (audio/video) server which currently supports Ogg (Vorbis and Theora), Opus, WebM and MP3 streams. It can be used to create an Internet radio station or a privately running jukebox and many things in between. It is very versatile in that new formats can be added relatively easily and supports open standards for communication and interaction."

2) A cloud server: where the software will work



Reference: https://digitalocean.com/

"DigitalOcean, Inc. is an American cloud infrastructure provider headquartered in New York City with data centers worldwide. DigitalOcean provides developers cloud services that help to deploy and scale applications that run simultaneously on multiple computers."

You need an account with Digital Ocean and if you follow this link you'll get $100 free credit to test with. If you then continue to use them as a paying customer who has spent $25, I'll be given a $25 credit on my account, that's enough to pay for all of my servers with them for a month, and if you tell your friends about them, they'll reward you with the same deal.

Sign up with Digital Ocean for $100 free credit

Affiliation Disclaimer: you've already been disclaimed of this tutorial's affiliation, but even if they weren't offering to pay me a few bucks I'd still recommend Digital Ocean as they're a solid hosting company who I've been with for years without any problems, other than 'my own stupid'.

How the free server credit deal works

The cost of your server will be deducted from your $100 credit, it'll be free till you've either spent the whole $100, or 60 days has elapsed, whichever comes soonest: most likely the 60 days as $100 can get you much more computational power than you need. Please refer to their referrals page for further info.

From now on I'll assume you've got your account with them all sorted out. If you're running an Ubuntu server with another provider like Amazon Web Services you can jump to the section on installing Icecast.

Part A: Creating a Cloud Server

It's time to spin up a server in the cloud, this should only take a few minutes and whilst it does get a bit technical, every step is covered so you don't have to worry: if you can read, click, copy and paste you're good to go.

Navigate to https://cloud.digitalocean.com/droplets/

At the top of the screen there's a green button that says "Create", click that, then click "Droplets" from the list.

Step One: Choose an image



This is the flavour of the server you're going to use, select "Ubuntu".

Step Two: Choose a plan



The smallest and cheapest server comes with:

  • 1 GB RAM / 1 CPU
  • 25 GB SSD disk
  • 1,000 GB transfer

1,000 GB is enough data for more than 10,000 people tuning in and listening for an hour at 192 kbps

Bandwidth Calculator: How much data do you need?

  • If you're already with a streaming provider check your stats to see how much data you need
  • If you're just starting out the $5 a month server should be enough to get you started
  • If you don't know how much data you need use this Bandwidth Calculator to work it out

Listeners:

Time:

Bitrate:

Step Three: Choose a Choose a datacenter region



Pick the DigitalOcean datacenter which is closest to your listeners.

Step Four: Authentication

Before you continue you're going to need two small, free, yet powerful bits of software that will help you secure your server, and then later be able to talk to it so you can install Icecast.

Download and install PuTTYgen

"PuTTYgen is a key generator tool for creating pairs of public and private SSH keys. It is one of the components of the open-source networking client PuTTY. "

Download and install PuTTY

"PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers."

Fire up PuTTygen.



Click "Generate", then to create some mathematical randomness which will help with the encryption, you'll need to move your mouse around in a random manner.



When the key has been generated, for your added security, you should also add a passphrase to the key. Make sure you can remember this, but make sure it's not easy to guess.

Click "Save public key", then click "Save private key", remember where you saved these keys, you'll need to know that in further steps.

Now highlight all the of goofy looking text from the top of PuTTYgen and copy this to your clipboard.

Your public key will look something like this:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAg4bvY4sWd8QfQZGjteRcHihj1jdA1yt62Q0roLf6eRQ+RIIPpu8y7dnRMnVfbQSlOkpKkMssJNY5FLVpprvZaIk4sbc40t1TZ7ZTDuSseH6Cez6LAEj1tDdA0Z3rFaQeAZtNYbJaXvIl6dP9PABvdR7fRDxViVQFsnXukJJP/lDFBjZOsjpD+HACxLpnQIghnwc3gYJW4w+cOnWzPwKjHaS1qm6h4ONX4Mjw8DIZTRBl8MNxwDK+tzlEgtiL+L4LD6PzSEWh8xAu0fMOWrE+ywLF9GLzZ6+durP3xx6iA/hT7Gxtcpud7YYQjgbQg2Hj7aBMfc1UH6T4YtJ/4v0/NQ== rsa-key-20200225

Return to the DigitalOcean site where you have a choice as to how you authenticate with your new server:



"Droplets that use SSH keys have password authentication disabled by default.
This makes them secure against brute-force attacks."

As you may have guessed, you're going for the stronger of the options. Select "SSH keys"

Click "New SSH Key", this will launch the screen below:



Paste your public key into the form, give the key a name and click the "Add SSH Key" button.


Step Five: Finalize and create



You only need one droplet but you should give it a friendly name like "Icecast-Streaming-Server".

BACKUP, BACKUP, BACKUP

Add backups. Just do it. On a $5.00 droplet it only costs $1.00 a month which is the smallest price to pay for the peace of mind it brings.



Now it gets exciting, press the big green "Create Droplet" button:



This will probably take about a minute to create your server, once it's done it'll be assigned an IP address.

Copy your new IP address. Write it down too.

Step Six: Logging into your new cloud server

Launch PuTTY and paste your IP address into the "Host Name [or IP address]" field.



On the left hand side menu on PuTTY double click the "SSH" option, then click "Auth" followed by clicking "Browse" next to the "Private Key File for Authentication" option.



Select your Private Key's .ppk file from where you saved it, then click "Session" from the menu at the very top.

Where it says "Saved Sessions" enter a name like "Icecast Server" and click "Save", now PuTTY will remember the details, and that makes it really easy to login to your server in the future.

Now, click the "Open" button in the bottom right corner of PuTTY to connect to your server.

You'll be greeted by a one-time "Security Alert", you know the server is sound, you just made it so go ahead and click "Yes" to proceed.



Where it says "Login as" you should enter "root" without the quotes, and all lower case; then hit enter, you will be prompted to enter the security passphrase you setup when you created your public and private keys, enter your secret passphrase, hit enter and you're logged into your new server!



You are now logged in!

Part B: Installing Icecast

Now you have a new server, let's turn it into a streaming server by installing Icecast.

According to the official Icecast installation guide it only takes four commands to install the latest version.

Step One: Add the repository

On your new Ubuntu server you'll be installing Icecast from what's called the repository, it's like an app store for servers and you just need to tell the server where to get the latest Icecast software from.

Copy the following command to your clipboard, then paste it into PuTTy:

sh -c "echo deb http://download.opensuse.org/repositories/multimedia:/xiph/xUbuntu_18.04/ ./ >>/etc/apt/sources.list.d/icecast.list"

To paste in PuTTY you need to right-click your mouse

PuTTy is peculiar software if you're new to it, it's not like your regular computer.

When you use PuTTy you're using one computer to talk to another: CTRL+V will not work, to paste you need to click the right mouse button.

Step Two: Import the Multimedia signing key

The official installation guide says: "You need to add the openSUSE OBS Multimedia signing key as a Trusted Key to your system." to do this copy, then right-click to paste the following into PuTTy:

wget -qO - http://icecast.org/multimedia-obs.key | apt-key add -

Step Three: Update your repository index

This is akin to updating the app store on your phone:

apt-get update

Step Four: Install Icecast

Now you're starting to get down to it!

apt-get install icecast2



The server will ask for your go ahead to install Icecast, type "Y" (without the quotes) and press enter.

It will then ask you if you want to configure:



Select "Yes", you can do this by hitting your left arrow key, then hitting enter.

It will now ask you to enter a fully qualified domain name, you're running Icecast on an IP address so delete where it says "localhost", then enter the IP address of your new server.



Press your down arrow key once, this should highlight "Ok" in red, hit enter.

Now you'll need to set a source password, the default is "hackme" for those who like to be hacked! You can change your Icecast passwords at any time: details later.



Again, you can hit the down arrow key to highlight "Ok" in red, then hit enter.

It will repeat the process for the "Relay Password" too, set it, but don't worry about it for now as you're not going to be using Icecast as a relay here.

You'll next be asked to set an "Admin Password", enter something folks can't guess, write it down for safety, then hit enter. At this point your screen will spit out line upon line of text whilst it does what it needs to.



You've installed Icecast: congratulations!

Now if you go back to your web browser and navigate to http://your_ip_address:8000 you should see confirmation that Icecast is installed.


Part C: Configuring Icecast

Now that Icecast is installed you need to configure it. To do this you need to edit a file, in PuTTy run the following command which will bring up a text editor called Nano:

nano /etc/icecast2/icecast.xml

Nano is different to text editors you'll get on your normal computer, I'll tell you what you need to press to get it working for you, but if you want to know more about it here's a beginner's guide to Nano.



If this is your first time working with XML, don't worry, it's colour coded in PuTTy and I'll explain it so it's not as intimidating, then I'll tell you what you need to edit and why.

  • Yellow text is a comment
  • Pale blue text is a tag
  • White text is a value

All you're looking to do here is change some of the white values: don't worry about the rest of it.

If you want to learn more about how to configure Icecast see the documentation for the config file.

Set the location:

Change the Earth value inside the <location> tag to your city, or the location of your server's datacenter.

"This sets the location string for this Icecast instance. It will be shown e.g in the web interface."

Change the admin email address:

Change the icemaster@localhost value inside the <admin> tag to your email address.

"This should contain contact details for getting in touch with the server administrator. Usually this will be an email address, but as this can be an arbitrary string it could also be a phone number. This will be shown e.g. in the web interface."

How many clients (listeners) should it support?

Under the <limits> section the value inside the <clients> tag sets how many listeners you can have at once.

You can push this higher than 100, Icecast can literally handle thousands of listeners: see load test results.

"Total number of concurrent clients supported by the server. Listeners are considered clients, but so are accesses to any static content (i.e. fileserved content) and also any requests to gather stats. These are max concurrent connections for the entire server (not per mountpoint)."

Double check you're happy with your usernames and passwords

Inside the <authentication> section make sure you are happy with the passwords that you set earlier.

Source Password: <source-password>value</source-password>

"The unencrypted password used by sources to connect to Icecast. The default username for all source connections is 'source' but this option allows you to specify a default password. This and the username can be changed in the individual mount sections."

Admin Username and Password: <admin-user>value</admin-user>
<admin-password>
value</admin-password>


"The username / password used for all administration functions. This includes retrieving statistics, accessing the web-based administration screens, etc. A list of these functions can be found in the Administration section of the manual."

Configure your Mountpoint

Use the down key down in PuTTY to work through the configuration till you see "<fileserve>1</fileserve>".

Just above that line is where you're going to paste your mountpoint's configuration. To get the code enter the details for your desired mountpoint in the form below, then click the "Generate Mountpoint Config" button.

Mountpoint Configuration Tool:

Mount Name:

Username:

Password:

Stream Name:

Stream Description:

Stream URL:

Genre:

Bitrate:

Server IP Address:

YOUR INFO IS SECURE
NO DETAILS ARE STORED


The XML for your Mountpoint:

<mount type="normal">
   <mount-name>CHANGE ME</mount-name>
   <username>CHANGE ME</username>
   <password>CHANGE ME</password>
   <stream-name>CHANGE ME</stream-name>
   <stream-description>CHANGE ME</stream-description>
   <stream-url:>CHANGE ME</stream-url>
   <genre>CHANGE ME</genre>
   <bitrate>CHANGE ME</bitrate>
</mount>

Right-click to paste that XML into PuTTY just above the line that says "<fileserve>1</fileserve>".

Further details on all the available mountpoint specific settings can be found in documentation for mountpoints, but the values you're using are explained below.

Mount Name:    <mount-name>value</mount-name>

The name of the mountpoint for which these settings apply.

Username:    <username>value</username>

"An optional value which will set the username that a source must use to connect using this mountpoint. Do not set this value unless you are sure that the source clients connecting to the mountpoint can be configured to send a username other than source. If this value is not present the default username is source."

Password:    <password>value</password>

"An optional value which will set the password that a source must use to connect using this mountpoint."

Stream Name:    <stream-name>value</stream-name>

"Setting this will add the specified name to the stats for this mountpoint even if the source client / relay provides one."

Stream Description:    <stream-description>value</stream-description>

"Setting this will add the specified description to the stats for this mountpoint even if the source client / relay provide one."

Stream URL:    <stream-url>value</stream-url>

"Setting this will add the specified URL to the stats for this mountpoint even if the source client / relay provide one. The URL is generally for directing people to a website."

Genre:    <genre>value</genre>

"Setting this will add the specified genre to the stats for this mountpoint even if the source client / relay provide one."

Bitrate:    <bitrate>value</bitrate>

"Setting this will add the specified bitrate to the stats for this mountpoint even if the source client / relay provides one. This is stated in kbps."

Saving the new configuration

Once you have added the mountpoint values you will need to save the Icecast XML config file, to do this press "CTRL+X" on PuTTy, it will then ask you to confirm: type "Y" (without the quotes) then hit enter.



It will ask you if you want to change the name of the file, just press enter and you've saved your settings.

Reloading Icecast to activate the configuration

Now you need to tell Icecast to load all the settings from the config file:

service icecast2 reload

You can use the reload command any time you've edited the icecast.xml file.

Now use your browser to navigate to http://your_ip_address:8000/admin/ and log in with the username admin, and the password you configured.



Learn more about the Icecast Admin Interface.

Part C: Streaming audio from your studio to Icecast

In these final steps you need to get audio from your studio computer into the Icecast server, this can be done with a tool like butt (Broadcast Using This Tool) which is free software, or inside your playout system: either way the information you need is pretty much the same.

Address:
Your IP Address
Type:
Icecast
Port:
8000
Mountpoint:
/mountpoint
Username:
Username
Password:
Password

Configuring butt to encode your output and send it your Icecast server

"butt (Broadcast Using This Tool) is an easy to use, multi OS streaming tool. It supports ShoutCast and IceCast and runs on Linux, MacOS and Windows. The main purpose of butt is to stream live audio data from your computer's Mic or Line input to an Shoutcast or Icecast server."



Launch butt, then click the "Settings" button, next click the "Server" tab, then click "Add" in the side panel.

Name your stream, select "Icecast" as the "Type", enter your stream's credentials from above, then click "Add".

Under the "Audio" tab on butt, select an "Audio Device" so you actually have some audio to stream!



Go back to the "Main" tab and click the "Save" button, then click the small play icon to start encoding.



butt should now start to encode the audio from your computer, and send it to your Icecast server.



If you need any help with butt take a look at the manual.

You are now streaming live: congratulations!

Checking Icecast and listening for the first time!

Now to check Icecast is picking up the encoded signal from butt.

Navigate back to http://your_ip_address:8000



Using a different computer; a tablet or a mobile phone, navigate to http://your_ip_address:8000/listen

If you do this on the same machine that you'll be sending your soundcard's output from, you will create infinite loops of auditory madness, it's best to use another device.



Now if you return to your Icecast admin page you'll see you've got a listener.



All working? Now is a good time to back everything up!

You've invested some time in this, let's make sure that work is safe. It'd be a good idea to backup your Public and Private keys, plus your Icecast administrator and broadcaster details.

If you'd like to replicate this server in the future you might want to learn how to take a snapshot.

Part D: Managing Icecast

Anytime you need to manage your server you just fire up PuTTy, select "Streaming Server" and click "Open", it'll ask you for your username, in this case it's "root" (without the quotes), then you need to enter your passphrase, then once you've entered that and hit enter, you're logged in.

These simple SSH commands are worth remembering to help you manage your Icecast server.

  • service icecast2 stop
  • service icecast2 start
  • service icecast2 restart
  • service icecast2 reload

If you run the stop or restart commands anyone who is listening will be disconnected, the reload command is best as it keeps your listeners connected, but still applies the changes you've made.

Any time you wish to change your source or admin passwords, or any of the details of how your Icecast is configured, you simply need to edit the config file again. Fire up PuTTY and execute:

nano /etc/icecast2/icecast.xml

Then just make the changes; hit CTRL+X to exit, type "Y" (without the quotes) to say yes to saving, and overwrite the file before running the "service icecast2 reload" command.

To exit PuTTY you simply type "exit" and hit enter.

Congratulate yourself, big time! You now have a brand new server in the cloud; you've got your head around some complicated stuff, you've installed Icecast, configured it and managed to encode audio from your studio to the server, and now anyone can listen, anywhere in the world.

If this helped, why not buy me a coffee, or give this page a share?

I know of streaming service providers who are seriously limited and charge good money each month, if this guide has helped get your radio station setup with an Icecast server, and saved you money, please consider passing some of your savings my way!

Frequently Asked Questions

In time I will add "Frequently Asked Questions" but first you need to email me some questions!

Has this helped?

I'd love to know which stations have been helped by this tutorial. Please drop me a mail and let me know.