Docker on Synology DSM

Logitech Media Server

I installed Docker after Synology discontinued support for the Logitech Media Server (LMS). Synology supports Docker on Intel based NAS only, so you cannot resort to this solution on DS212+ and DS213+. To continue to use LMS on those platforms you must not upgrade to DSM7, and you must not upgrade Perl v5.24 to a newer version. If you do, the Logitech Media Server package will not start anymore. Remember to disable auto-update for the Perl package.

The following guide explains how to install Docker and the latest Synology Media Server.

Installation

  1. Install Docker from the DSM Package Center
  2. Open Docker, select Registry, and search for “lms”
  3. Choose lmscommunity/logitechmediaserver and download the image as latest or stable
  4. SSH into your DSM and create folder lms in /volume1/docker/ as user, not as root
  5. Create the container from the command line
    sudo docker run \
    --name logitech-media-server \
    --restart=unless-stopped \
    --net=host \
    -v "/volume1/docker/lms":"/config":rw \
    -v "/volume1/media/music/flac":"/music":rw \
    -v "/volume1/media/music/Playlists":"/playlist":rw \
    -v "/etc/localtime":"/etc/localtime":ro \
    -e TZ=Asia/Bangkok \
    -e HTTP_PORT=9002 \
    -e PGID=100 \
    -e PUID=1026 \
    lmscommunity/logitechmediaserver:[latest|stable]

    Note that you must set all volumes initially to Read/Write permissions. Use HTTP_PORT=9002 to make the server run on the same port as the previous app, and to avoid conflicts with other apps on your NAS. PGID=100 means users and is the same for every DSM, but PUID=1026 must reflect your user ID which is used to save your music files on the NAS. Open /etc/passwd from the CLI and find the entry for your user name, which contains the user ID, the group ID, and the default shell run when opening a CLI, e.g.

    user:x:1026:100::/var/services/homes/user:/bin/sh

    Depending on your docker image download uses “latest” or “stable” without the square brackets.

  6. Synology DSM uses ACL for permission management, which is not transferred to the container when the container is set up. To allow the user squeezeboxserver access to the media files you first need to login to the container's file system and change permissions like this
    sudo docker exec -it logitech-media-server /bin/bash
    chmod -R u+rws,g+rws /music
    chmod -R u+rws,g+rws /playlist
    exit

    New media folders and files created after the container is setup will inherit permissions from the parent folders automatically.

  7. Go back to DSM and stop the container “logitech-media-server”, then Edit the container
    • Under General Settings, select Enable auto-restart
    • Under General Settings, select Create shortcut on desktop –> Web page: http://neptun:9002
    • Under Volume, select the /music path to mount as Read-Only
    • Check your settings under Environment
  8. Start the container
  9. Icon on DSM Desktop: to get the user experience even closer to the original LSM package you can manually install a small package which shows in DSM with the original LSM icon and opens LSM on click. This imitates the behavior of the DSM Desktop icon of the original LSM package, it does not start the container, and it works only if LSM is already running. I made the Logitech Media Server URL Package for DSM 6.x with the help of Valery Letroye's excellent Mods Packager.

Settings of Logitech Media Server

  1. After the container is running Logitech Media Server will start scanning your music library. Check the logs as explained in Trouble shooting below if the library remains empty after the scan, or if not all folders are scanned into the library.
  2. Enter “/playlist” in the Playlists Folder under Basic Settings if it's missing
  3. Modify time and date settings under Interface

SqueezeBox Radio

Unfortunately the latest Squeezebox Radio firmware (7.7.3) comes with a bug which prevents it from connecting to Logitech Media Server 8+. But there's a patch available:

  1. On the Radio go to Settings –> Advanced –> Applet Installer and install the Patch Installer. The Radio will re-boot.
  2. Once it's back, go to Settings –> Advanced –> Patch Installer and install the Version Comparison Fix. The Radio will re-boot.
  3. If the Version Comparison Fix does not show up, switch the SB Radio off and back on first.

Trouble shooting

  • Check the logs in /volume1/docker/lms/logs
  • If you experience any trouble it might be helpful explore the file system within the container. Use the container name given when creating the container
    sudo docker exec -t -i logitech-media-server /bin/bash
  • Check that user squeezeboxserver within the container has been assigned the same user ID as the the user ID you set when creating the container (e.g. 1026)
  • Note: I had no problems connecting my Squeezebox Radio's to LMS 8.1.2, as described in SB Radio and Logitech Media Server 8+