Logitech Media Server

Setup a Home Media Server using an Open Source project



For this project we are going to be using an Open Source project called Logitech Media Server, there is a Docker install, Pi install, and Kubernetes option. The project is open source and privacy forward, so by default everything is done locally so you can control your own data. You can either stream media such as music or audio books to your tablets/phone/computer you can also stream music to your smart speakers if you have some. The Github for this project is here the code has been released under the GPLv3, so even though this used to be owned by Logitech for their systems, they have released this server as open source for the community and no longer make the Squeezebox server this was based on.

Rating

Skills and assumed supplies

NOTE: Need a refresh? Check out my YouTube playlist on how to use the Command Prompt

Supplies and costs

Logitech Media Server

Unsure what to pick? Try the Docker command! You will need a Server with Virtualization installed, but the Docker install is pretty straightforward and they have documentation focused on the Docker way to do the install Here.

How to set up Logitech Media Server using Docker

First we need to login to our server, you can do this on SSH if you want, or by going over to your server and logging in if it has a monitor. If you need a refresh on how to SSH into a server I made a video for you! It's here. Then we can run the given Docker command from the documentation. You'll need to scroll down to the portion that is for container installs.

docker run -it \
                    -v "/PATH":"/config":rw \
                    -v "/PATH":"/music":ro \
                    -v "/PATH":"/playlist":rw \
                    -v "/etc/localtime":"/etc/localtime":ro \
                    -v "/etc/timezone":"/etc/timezone":ro \
                    -p 9000:9000/tcp \
                    -p 9090:9090/tcp \
                    -p 3483:3483/tcp \
                    -p 3483:3483/udp \
                    lmscommunity/logitechmediaserver

NOTE: You should change PATH so that it matches your machine. Some examples might be /LMSconfig or /LMSplaylist. Because this is where it saves things like the configuration files, playlists and finds your music, it's important to know where everything is on your machine.

Now one thing to note, you'll see \ on the lines in the documentation, you don't type those in, those are there to indicate that the command continues even though it's on a new line. One way to handle this is to copy/paste the command into a text file, make your edits, and then copy/paste into your terminal. That way you don't have to risk typos, or deal with scrolling through a long command on the terminal.

How to set up Logitech Media Server using Kubernetes

If you haven't already set up your namespace, I recommend you do that first. I have a sample recipe for that here that will create a namespace called smart-home, you can reference how to use kubectl if you want to refresher on how to set that up. Check to make sure your namespace is up by doing
get namespaces

image of making sure namespace was created

Next we need to setup our YAML file for Logitech Media Server, a sample is here, you can use this but you MUST change the location of your path. I have a comment in there on where to change the YAML, and some notes about how the YAML is put together, but you have to make sure you have a path to where you want your information stored.

If you update nothing else in that file, you still HAVE to update the path in BOTH places on the persistent volume areas. The YAML paths for the volume mounts can stay the same. But in the persistent volume and persistent volume claim, those paths MUST change to match your server setup. For example, on my server it would be /media/aholdengouveia/kubernetes/ because I put all my kubernetes data under my username so I can find everything easily.

If you need a reminder on how to use kubectl please go check out my kubectl guide here and make sure to run in the correct directory

Now you're set up to start trying out Logitech Media Server. NOTE: you'll be accessing your Logitech Media Server through a web browser, this browser needs to be on the same network as your server because we're using local addresses which are likely to be 192.168.X.X or 10.10.X.X You can see my container is 192.168.3.13 for the media server

How to set up Logitech Media Server using a Raspberry Pi

You'll need a Pi, power supply, SD card and an ethernet cable. You will need to know how to see the IP address of your Pi, this can be done in several ways, option 1 is logging into your router and checking the address of the Pi, option 2 is logging into the Pi and running
hostname -I
You're likely to see the address as either
192.168.X.X
or
10.10.X.X

You'll first want to get your pi ready, to do that you need to copy the raspbian OS onto your SD card using something like Etcher. You'll download the Etcher program, download Raspbian and then put Raspbian on your SD card. More details can be found at Raspberry Pi documentation this includes links to videos, troubleshooting guides and more.

After you have your pi up and running with Raspbian, you should login to your pi either through SSH or with a monitor so we can do the next steps. There is a guide for Installing Logitech Media Server on a Pi here, and I will tell you the basic commands. If you need a refresher on the command prompt, make sure watch my Linux FAQ playlist!

Next you'll need to install the server, I'm assuming you have some music or audio books on your pi, but if you don't the guide linked above will also talk you through how to add a hard drive to your pi.

The documentation for the Logitech Media Server is Here for Raspbian install.

How to use Logitech Media Server

First we need to open up the dashboard. You'll need to go to the IP address of your Raspberry Pi, or container in your web browser.

http://IPaddress:9000

image of the LMS working but before the first library scan

Now the next think you'll need to do is find your music. There are some options to add in radio stations if you want, but if you have legal copies of your CDs on your server for example, you can find those and add them to the LMS here. More info about legal copies of CDs you own can be found here. You'll go into the settings, and point to the folder(s) that have your music. In my case you can see I've pointed it at my music, audiobooks and other audio files.

image of LMS settings that point to your music or other audio files

Now that your server is setup, it's time to add music, once you go to the settings to point at your audio files, you can add music to the system.

NOTE: This system is a multi part system, you have the server which hosts your music and allows you to choose what is playing where, but it is NOT a player. You will need a player and a controller. This could be smart speakers that you already own, or you build or an old android device you have laying around. This server has a web interface that I think is pretty good, but you must have a player to hear the music. I used Squeezebox, which can work on Linux laptops, but there is a way to have it work on Android tablets and phones which I will cover below.

Linux Squeezelite install

Squeezelite is something you can install on your android tablet or phone, or your linux laptop as a way to be able to play music. Remember, the server will send music but not play it, you MUST have something with a speaker and player to be able to play your music.

To install squeezebox on Linux Ubuntu will pull up the terminal and do the following steps

I do recommend renaming your players so that it's clear which one is playing what. For example, my Magic Mirror has a speaker attached so I can play music on that by following the above steps to install and run squeezeplayer, and then in the settings of the media player, I can see the options for my mirror including renaming it.

squeezelite running on kitchen  magic mirror

Android Phone/Tablet Squeezelite install

You can also install this on your Android Phone, if you want to play music on your android phone or tablet. NOTE: There is an app you can install for $4.99USD Called SqueezePlayer by Stefan Hansel Solutions UG (haftungsbeschränkt) if you prefer that, their website is here if you want more info on that. I also bought this app for testing, and can confirm it's easy to use if you prefer paying for an app over doing an install as above.

Home Assistant Integration using Home Assistant Community Store (HACS)

One thing you can do to make this system more a part of your home is to integrate with Home Assistant if you have an instance up and running. The official page on this integration is here. But I will warn you, I did not find it straightforward how to do this, so I've included a lot more details below.

Congratulations! You are now ready to Listen to some music! Have fun!

Recommended Upgrades