There are a lot of music servers like Kodi and Emby which can be installed on the Raspberry Pi to turn it into a home music server, but the most convenient music server is mobidy whose installation and setup have been discussed in this write-up.
How to install the Mopidy on the Raspberry Pi
First, let us make sure all the packages of the Raspberry Pi operating system are up to date by using the command:
Once all the packages are up to date, we will install the Mopidy by downloading its apt-key using the command:
The “OK” in the output is confirming the apt-key of Mopidy has been successfully added, now we will add the installation files of Mopidy in the Raspberry Pi repository using the command:
After this, update the repository of the Raspberry Pi using the command:
For the installation of the Mopidy on Raspberry Pi using the command:
For the confirmation of installation of the Mopidy, check the version of the installed Mopidy package using the command:
Now we will add this Mopidy user in the video group of the Raspberry Pi using the command:
To run the service of the Mopidy so that it can run in the background upon Raspberry Pi reboots, use the command:
How to configure the Mopidy on Raspberry Pi
If you want to access the Mopidy using the web browser or another device, you have to make some changes in the configuration file of Mopidy which is located at “/etc/mopidy/mopidy.conf” by opening it in nano editor (you can use any other editor too):
A file will be open like this:
Now to access it from the web browser add the following lines in the file:
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname
Similarly, if you want to use the 3.5 AV jack for listening to the music instead of the HDMI cable, then add these lines too:
In the above lines of “device=hw:1,0”, “1” is used for the card number and “0” is used for the device, which is mostly used by the AV jack. Save the changes made in the configuration file of Mopidy by pressing CTRL+S and exit the nano editor by using a shortcut key, CTRL+X, now start the Mopidy service using the command:
How to access the Mopidy from a web browser on the Raspberry Pi
To access the Mopidy from the web browser we have to web client of “Iris” using the pip repository by running the command:
Now we have to provide the access sudo permission to the IRIS by using the command:
Restart the Mopidy service by using the systemctl command:
Now open the chromium-browser on the Raspberry Pi and type the following URL address to access the Mopidy from the web browser with the help of an IRIS web client:
How to add music to the Mopidy
To add the music from the directory of the Raspberry Pi to the Mopidy, we need a Mopidy-Local extension that can be installed using the command:
Now we will once again open the Mopidy configuration file using the command:
And add the following line so that we can scan the audio files from the /home/pi/Music folder and add them to the Mopidy:
media_dir = /home/pi/Music
Save the changes then exit the editor and restart the Mopidy service using the systemctl command:
To access the files the convenient way is from the web browser open the http://raspberrypi:6680/iris/settings, go the settings of the web page, scroll down the web page and click on the “Start local scan” button:
Then open the URL http://raspberrypi:6680/iris/library/tracks to view the added tracks on the Mopidy:
Conclusion
The Mopidy is a music server that can be installed on the small size computer boards known as the Raspberry Pi. These are very convenient for the users to add the songs in their own customised music playlist and can listen to them by single click from the web browser. In this write-up, we have learned the method of using the Mopidy to turn the Raspberry Pi into a Home Music Server by installing and setting it up on Raspberry Pi.