I have a ton of ripped music. After setting up and getting used to MPD, today I discovered CherryMusic Server

This is what I was looking or originally. I’m sure I’ll use MPD for what it’s good at - but this is a better interface than Plex for listening to streaming music from home (so far).

Get CherryMusic

CherryMusic depends on Python. Although it also runs with Python 2, Python 3 is recommended for best performance and all features.

sudo apt-get install python3

CherryMusic has several optional dependencies, which should be installed for a seamless user experience:

sudo apt-get install mpg123 faad vorbis-tools flac imagemagick lame python3-unidecode

Optionally, you can replace the packages mpg123, faad, vorbis-tools, flac and lame with ffmpeg if you like. The advantage with ffmpeg is that you can also decode WMA files. If you are not running a headless server, consider installing “python3-gi”, which allows you to use CherryMusic’s GTK system tray icon.

Configuration and setup

For security reasons it it highly recommended to run CherryMusic under a dedicated Linux user. First, create the user “cherrymusic”:

sudo adduser cherrymusic

Now, switch to the newly created user:

su cherrymusic

There are two branches of CherryMusic: the stable main release (“master”) and the development version, called “devel”. I highly recommend the development branch, as it often is several steps ahead of the master release and provides all the new features. In this guide I also chose the devel branch. However, if you insist on using the master release, simply replace all occurrences of devel with master.

Now, get CherryMusic:

git clone --branch devel git://github.com/devsnd/cherrymusic.git ~/cherrymusic-devel

This command will download the develop branch of CherryMusic and place it in your home directory.

Due to a shortcoming in Debian, the repositories do not provide a recent version of the package cherrypy and the package stagger is not available in the Debian repositories at all. However, they can be fetched locally and simply put into the CherryMusic directory. CherryMusic has a build-in function, that checks if those two packages are available on the operating system and if necessary offers to automatically download and store them locally in the CherryMusic directory — without installing them on your system. This provides a clean way to get CherryMusic running on Debian. Simply change to the CherryMusic directory and start the server application with the –help switch (you will be prompted then):

cd cherrymusic-devel
python3 ./cherrymusic --help

Now, do the initial start-up to generate the configuration and data files in your home directory:

python3 ./cherrymusic

This creates the configuration file ~/.config/cherrymusic/cherrymusic.conf and the directory ~/.local/share/cherrymusic/, where the user data is stored.

Before you head on, edit the configuration file to point to your music library and make any other changes.

CherryMusic uses a database to search and access files in your music collection. Before you can use CherryMusic, you need to do an initial file database update:

python3 ./cherrymusic --update

To reflect changes in your music collection, you need to repeat this step every time you make changes to your music collection. On a standard computer, even very large music collections should not take longer than a few minutes.

Create a systemd service

CherryMusic doesn’t have a daemon, but we can fake it with a systemd script to start the service

Make sure you are logged in as someone with root or sudo rights (exit the cherrymusic user account if you’re still connected) and create the file /etc/systemd/system/cherrymusic@.service with the following contents:

[Unit]
Description=CherryMusic server
Requires=network.target
After=network.target

[Service]
User=%I
Type=simple
ExecStart=/home/cherrymusic/cherrymusic-devel/cherrymusic
StandardOutput=null
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target

Enable and start CherryMusic

Enable the systemd service to start on each boot:

sudo systemctl enable cherrymusic@cherrymusic

Start the service

sudo systemctl start cherrymusic@cherrymusic

Finishing up

Open a web browser on a computer connected to the same LAN the CherryMusic server is in and go to http://<ip>:<port>, where ip is the IP of the server and port the port specified in the CherryMusic configuration file (defaults to “8080”).

Create an admin user and the basic setup is done.


Reference