DEV Community


Posted on

Tape-selecta Online Radio Station

What is Tape-selecta?

Tape-selecta is a dockerized Icecast2 server together with Ezstream and Node.js that makes the perfect way to set up your own online radio station following just a few simple steps.

How does it work?

The setup is very simple:

  1. Install Docker.
  2. Copy your mp3 files into the music directory.
  3. Run
  4. Check localhost:8000/mountpoint, your music should be streaming there!


The is the script that chooses what is the next file to be streamed. By default, the script just randomly picks the next file to be played. Have a look at the code:

#pick a random mp3 file under /home/music
song=$(find /home/music -name *.mp3 | shuf -n 1);
#write mp3 tag information to status.json
mp3info -p '{"title": "%t","artist": "%a" ,"category": "'${genre}'"}' "$song" > /home/info.json
#echo the info
echo $song;


Before running your online radio station, it is important to make some security changes to the configuration of the Icecast2 server. Change the content of the file icecast-config/icecast.xml:

    <!-- Sources log in with username 'source' -->
    <!-- Relays log in with username 'relay' -->

    <!-- Admin logs in with the username given below -->

After this change the content of the ezstream-config/ezstream_mp3.xml file to match the password choosen for the Icecast2 admin user.


There are some other configuration options in both xml files please check the Icecast documentation page and Ezstream documentation page to know more on the subject.

Front end

The code of the project includes an Express/Node.js server, ready to the static files included in the web/public directory.
Futhermore, it is possible to retrieve the information of the current track playing in the endpoint localhost/status, the information can be useful in case we want to show information of the track provided by the mp3 tags of the file.

Next steps

If you setup your own radio station, please let me know! It would be great to have a community of self hosted stations and get to know your ideas for it.

Discussion (0)