====== 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 ====
- Install Docker from the DSM Package Center
- Open Docker, select //Registry//, and search for "lms"
- Choose // lmscommunity/logitechmediaserver// and download the image as //latest// or //stable//
- SSH into your DSM and create folder //lms// in /volume1/docker/ as user, not as root
- 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.
- 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 thissudo 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.
- 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//
- Start the container
- 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 {{ :syno:logitech_media_server_url_package.zip |Logitech Media Server URL Package}} for DSM 6.x with the help of [[https://www.beatificabytes.be/add-custom-url-shortcuts-into-synologys-dsm-start-menu-or-on-dsms-desktop/|Valery Letroye's]] excellent [[https://github.com/vletroye/Mods|Mods Packager]].
==== Settings of Logitech Media Server ====
- 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.
- Enter "/playlist" in the Playlists Folder under //Basic Settings// if it's missing
- 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:
- On the Radio go to //Settings --> Advanced --> Applet Installer// and install the //Patch Installer//. The Radio will re-boot.
- Once it's back, go to //Settings --> Advanced --> Patch Installer// and install the //Version Comparison Fix//. The Radio will re-boot.
- 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 [[https://github.com/Logitech/slimserver/#sb-radio-and-logitech-media-server-8|SB Radio and Logitech Media Server 8+]]
==== Links ====
* [[https://linuxhint.com/run-docker-containers-synology-nas/|Running Docker Containers on Synology NAS]]
* [[https://registry.hub.docker.com/r/lmscommunity/logitechmediaserver/|Logitech Media Server (Dockerfile)]]
* [[https://forums.slimdevices.com/showthread.php?111876-LmsUpdate-and-LmsRepack-Synology-8-0-*-packages/page31&p=999039#post999039|Tutorial on Logitech Media Server using Docker container on Synology]]
* [[https://forums.slimdevices.com/showthread.php?111828-Official-docker-container-for-LMS/page30&p=1001459#post1001459|Docker on Synology DSM 6.x suggestion (CLI)]]
* [[https://stackoverflow.com/questions/20813486/exploring-docker-containers-file-system|Exploring Docker container's file system]]
* [[https://docs.docker.com/engine/install/linux-postinstall/|Manage Docker as a non-root user]]
* [[https://community.synology.com/enu/forum/17/post/102280|Connect to a docker container from outside the host (same network)]]
* [[https://stackoverflow.com/questions/56825258/whats-the-difference-between-docker-bridge-and-host-modes|What's the difference between docker BRIDGE and HOST modes?]]
* [[https://github.com/xtianfall/docker_SynologyNAS|How to install Docker on non-intel Synology NAS]] **not verified!**
* [[https://www.beatificabytes.be/add-custom-url-shortcuts-into-synologys-dsm-start-menu-or-on-dsms-desktop/|Add Custom URL Shortcuts into Synology's DSM Start Menu or on DSM's Desktop]]
* [[https://github.com/vletroye/Mods|Mods Packager]]
* [[https://github.com/vletroye/Mods/releases/tag/v7.3-beta.1|Mods Packager Beta 7.3]]
* [[https://github.com/vletroye/Mods/wiki|Mods Packager Documentation]]
* [[https://github.com/Logitech/slimserver/#sb-radio-and-logitech-media-server-8|SB Radio and Logitech Media Server 8+]]