cheesecake.cv

visitor count

music streaming server

this entry contains a guide on how I set up my music streaming server

the hardware requirements aren't steep; at a minimum, you'll need a CPU (either x86 or ARM are fine) with an FPU for being able to encode/decode the audio quickly and ~2GB of ram; however, more is appreciated. You'll also need ample storage for music files

I'm running debian 13 on my server, it has 4vCPUs, 8Gb of ram and 1Tb of dedicated storage for music files

the software used for streaming is mpd, which is a daemon for playing music and allows you to set up an http stream. It is controlled remotely using one of its many clients, the one I use is rmpc

for finding and sharing music files I use slskd, which is a client for the soulseek network able to be controlled remotely via a web interface. I'll not go over how to set it up

setting up mpd

  1. install mpd on your system, for debian, run the command
    # apt install mpd
  2. open the configuration file in your prefered editor
    # vim /etc/mpd.conf
  3. set up the music directory and user mpd will run as, the user you set up must have access to all directories used by mpd
  4. to remotely control the server, set bind_to_address to 0.0.0.0, port to your desired port and password to a secure password
  5. add a new audio output for your http stream:
    audio_output {
    	type		"httpd"
    	name		"http stream name"
    	encoder		"flac"		# run mpd --version to see available encoders
    	port		"8000"
    	always_on       "yes"	# prevent MPD from disconnecting all listeners when playback is stopped.
    	tags            "yes"	# sends song information to connected streams 
    }
  6. start/enable mpd with
    # systemctl start mpd
    # systemctl enable mpd
  7. expose the necessary ports on your firewall

that's it. you should probably try different encoders a bit and find what works best for you, you can also change the format for sub-cd quality to listen to the audio, open it as a network stream in whatever software you like using, like vlc