On Debian server
You can configure this even on your headless remote server as this does not require sound card. Only terminal connection to your server is needed.
Install mpd music player daemon
apt install mpd
Comment out and add your server address
You could uncomment change port to control mpd daemon and change
Uncomment and setup your password for daemon when connecting with client. You can configure access level using read,add,control,admin.
#name "My ALSA Device"
name "My HTTP Stream"
encoder "vorbis" # optional, vorbis or lame
bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
# quality "5.0" # do not define if bitrate is defined
bitrate "96" # do not define if quality is defined
max_clients "0" # optional 0=no limit
To make configuration available you need to restart mpd daemon.
sudo service mpd restart
Install mpc client
sudo apt install mpc
You can configure password and port for client connection using environment variables.
Create symbolic link to your own music folder where permissions should allow other users at least read files.
ln -s /home/user/music /var/lib/mpd/music/
Go to mpd music folder/var/lib/mpd/music/ and add all files to default mpd playlist
mpc ls | mpc add
Check if files are on playlist using
mpc playlist and play using
There is also very nice and practical ncurses based CLI app named ncmpcpp
sudo apt install ncmpcpp
You can now enter to your server website via web browser typing
If everything is ok, you’ll hear now music and your music stream is all setup.