Self-hosting a music streaming service
Neon Faction operates a self-hosted web radio station here. We use a combination of two services called icecast2 and mopidy. Let's set up icecast2 first.
First, we will install icecast2 onto our system with the following command:sudo apt install icecast2The package manager will likely walk you through some basic configuration for icecast. This will include setting a hostname and 3 passwords. Don't worry too much about these passwords yet, they will be easy to change later. Then we navigate to where icecast2 saves its config file.cd /etc/icecast2Typels
to view the contents of this directory. You should see an admin and a web directory, and then a file named icecast.xml. Lets edit that file.sudo nano icecast.xmlYou can see there is a ton of text here. We highly recommend replacing this config file, with our config file. There are a variety of ways to do this, but the fastest is this:Ctrl+X to exit without saving changes sudo rm icecast.xml wget https://www.neonfaction.xyz/configs/icecast_config.xml sudo mv icecast_config.xml icecast.xmlOnce you have the file downloaded, edit the neccessary fields. Make sure to set secure passwords for the source, relay, and admin passwords. The passwords should all three be different from one another. Finally, you can test the config by executing:sudo service icecast2 startAt this point, open a web browser on any device on your network, and navigate to either the hostname:port or ipaddress:port of the machine running icecast2. You should see an admin page for icecast2. If you do not, refer to Icecast's Documentation for further assistance.