Spotify is nice, isn’t it? Well it isn't good/nice in my opinion! Spotify is proprietary software, and it’s another subscription service that I don’t really want to pay for, especially considering I already have my own music library at home.
Now, how would I make my own spotify, as the title suggests? It’s pretty simple actually. For this guide, you’ll most likely want a dedicated server if you plan on having your server accessible from outside your home, this is because you’ll need to forward a port. You’ll also want to use a *nix variant (Linux/BSD), these will play nicer with SSH and mounting HDDs remotely (SSHFS). In this guide, I’ll be assuming that you use Linux, specifically Debian on the server side (and client).
1. In your router settings, forward port 22 on the server you'll be using for your music library, this is for SSH (Secure Shell, a remote login shell) and SSHFS (Secure Shell File System).
It may be a good idea to change the port SSH listens on to something else instead.
2. Set up a music folder on the server, just put every music file you have in this directory, it'll make everything less complicated. For this guide, I'll use the example directory of
/home/james/Music
.
3. After moving all of your music related files to your Music directory, install a music player on the client device (Your server will be "serving to the client"). For this guide, I'll be using cmus.
4. Make a folder named sshmount in
/home/james/
on the client device, the path will be
/home/james/sshmount
, this is where you'll mount your server to on the client device.
5. Mount the server, the syntax should be (as an example):
sshfs james@192.168.100.102: sshmount/
.
The IP address you are connecting to would be your servers, and it will change depending if you are on the same network as the server or not. Look up "What is my IP address" to find out your external IP address if you want to connect while away from home.
Now, your servers hard drive should show up as being mounted in your file manager of choice.
6. Open cmus in your terminal emulator, and then type
:add sshmount/Music
.
This will add your servers music folder to the list of directories cmus scans for music.
After that, cmus will begin to build its library on your client.