Wednesday, February 10, 2016

Personal streaming music server


I would like to have a private Spotify / Google Music / Apple music like setup. For free. As I already have bought the music once in the past.

Music files would be stored at home, but accessible anywhere. This way I could listen to all my favourite songs on the go. And do this with low end smartphones which have limited storage capacity but flat fee 3G/4G network access.



Raspberry PI to start with.


  • Both the server and the mobile application keep on crashing
  • Depends on Tondo servers to be available. I can only hope their freemium business model is sustainable forever.
  • Implemented in Java
    • Needs to be configured for low ram from defaults

    • You need patience to start it up on a Raspi model B 
  • Auto start for now
    su -c /var/madsonic/standalone/ pi

    Mobile application


    General host/network setup

    • Public IP - attach to a VLAN outside the firewall
    • Dynamic DNS from
    • Set up DNS update in /lib/dhcpcd/dhcpcd-hooks/
    case "$reason" in
    curl -u user:pass ''

    • Set up usbmount to automatically mount USB sticks

     sudo aptitude install usbmount

    • Set up NAT from a privileged port to an user process
    iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 4040