I've been an iTunes user for more than a decade, in fact going on two decades now. I liked it, and still like it somewhat, but with the move to split everything out, the interface is painful to me. Getting music to my local machine is a hassle. I also have become less and less pleased with the thought of someone else holding my data (in this case my music). I paid for it, I own it, and I've collected it for more than 35 years now. Why should I not have it locally?
Before I get comments, yes, I know I can download it, but that goes right back to the hassle.
I've bean looking for solutions to host and stream from my own home server. It wasn't hard to find several viable options, but Ampache kept popping up. So here are my show notes with Installation, first run wizard, and a few admin items you'll likely want to take care of early on as you setup your own Ampache streaming server.
WE will be using Docker to install Ampache from the official ampache docker image. Docker is an excellent tool for running extremely minimal virtual servers so there's not all the bloat of a full virtual OS install.
I'm using Ubuntu 18.04 (Zorin 15.2), so I'll be using the Docker-CE installation instructions found on Digital Ocean's site to install Docker. If you don't have Docker installed yet, feel free to jump over there and get it installed first. If you have a different OS (Newer or older, different Linux distro, Windows, or MacOS) just google around for the instructions to install Docker-CE on your OS. :
Installing Ampache, once Docker is installed is really quite straight-forward. A few things we want to keep in mind:
I mapped /home/brian/Music/ampache to /media and this has worked well for me. So let's begin.
First we'll setup the directory for our music storage.
Starting from my home directory on my server, /home/brian, I'll change directory into Music, then make a new directory called ampache.
Done! Not too bad, right?
Next, we want to put some of our music in this folder. You can use the cp command to copy music from one folder to another, or the mv command to move it (cut / paste), or scp to copy music from a remote machine. Of course, if you are running a GUI (Graphical User Interface) on your server, you can use all of the normal methods for getting music to the ampache directory you just made.
Now we need to get Ampache installed. For this we use a very straight-forward one liner in Docker. Depending on whether you've added your user to the docker group or not, you may need to use sudo to run these commands. I'll put them with sudo, but if you are part of the docker group, feel free to leave it off.
sudo docker run -d --name=ampache -v /home/<your user>/Music/ampache:/media -p 8051:80 -p 8543:443 ampache/ampache
What we are doing above is explained like this:
sudo -> do this as a super user with root permissions
docker run -d -> fun this docker container as a daemon (a service that runscontinuously in the background)
docker run -d
--name=ampache -> call this container "ampache" so I can find it in a list of containers.
-v /home/<your user>/Music/ampache:/media -> map my host machine folder (and yes you need to put your actual username for the host server where it says "<your user>") to the "/media" directory in my container.
-v /home/<your user>/Music/ampache:/media
-p 8051:80 -> map my host port 8051 to the container port 80. NOTE: this step isn't required if you aren't running anything else on this server that uses port 80 already.
-p 8543:443 -> map my host port 8543 to the container port 443. NOTE: this step isn't required if you aren't running anything else on this server that uses port 443 already.
On the two NOTES above, keep in mind, it may still be useful to point a non-standard port to 80 and 443 in the container as it leaves you room to use NginX or another Proxy server when you want to reach your music server more easily and securely from outside your home network.
ampache/ampache -> pull down the official ampache image to build our container from.
You may want to add one more flag and option.
--restart=unless-stopped -> this option will restart the container if it should crash for some reason, or if the system should do an automatic reboot during the night. It won't restart on it's own, however, if you intentionally stopped it using the docker stop <container name> command.
docker stop <container name>
After the docker command finishes running you shoudl be able to reach your server at it's IP address and whatever port you mapped to the container port 80. For me it is http://192.168.7.125:8051 (your's will likely be different).
The first time you visit the running site, you'll run through a "First Run Wizard". This wizrd helps you setup an administrative useer, the database (mysql included in the image we pulled) connection, and just makes sure everything we need is installed.
Click on Admin >> Add Catalog. From here, give you catalog a name, then move down and make sure 'local' is selected. Finally, give the path of /media for the location of your music. Click 'Go' and the music should begin filling your Ampache system pretty quickly.
You can now navigate to 'Songs' on the main view (the little headphones icon), and see your list of music as it's being built.
This is a very brief overview of what Ampache can do, and how to install and get it running. So before you invest hours or days in getting your music and playlists setup, make sure to get everything else setup just like you want it in your server. That way if you bork it, you can nuke and pave an dnot lose tons of effort in the process.