NFS Shares
I have all of my media on a Synology NAS and mount it to the Plex server using NFS. So, first we need to create and mount those shares to the Plex server.
Enable NFS Sharing on Synology
Enabling NFS is located in the Control Panel -> File Services -> NFS:

Create a Share for Media
Shares can be created in the Control Panel -> Shared Folder. The general share settings aren't particularly important as I do not use SMB, but instead use NFS to mount them. Once a share is created, the NFS settings can be found by selecting the share, clicking on Edit, and selecting the NFS Permissions tab. This needs to be done for each share that will be connected via NFS.
Currently I have the following shares connected to my docker VM for the media server:
- books - stores books for lazy librarian
- media - storage location for all media
- temp - temp folder for tdarr to process files
- torrents - location for files downloaded by deluge and SABnzbd
Mount the Shares in the Docker Server
These shares will be mounted in the /mnt directory, which is exactly what that folder is intended for. Folders can be made by:
The NFS client service can be installed using:
The fstab file can be edited to mount the shares at boot:
I've added the following content at the end of the file:
#HANDYNAS MOUNTS
192.168.0.11:/volume1/books /mnt/books nfs defaults,_netdev 0 0
192.168.0.11:/volume1/media /mnt/media nfs defaults,_netdev 0 0
192.168.0.11:/volume1/temp /mnt/temp nfs defaults,_netdev 0 0
192.168.0.11:/volume1/torrents /mnt/torrents nfs defaults,_netdev 0 0
the _netdev option ensures that the system will treat the mount as a network device and not a local disk.
These new network shares can be mounted manually after reloading the daemon:
If they mount successfully, they will mount automatically on boot.
Now if you create a file or directory in the share you should see it reflected on both the server and the Synology:
sudo touch /mnt/books/test
ls -la /mnt/books
sudo touch /mnt/media/test
ls -la /mnt/media
sudo touch /mnt/temp/test
ls -la /mnt/temp
sudo touch /mnt/torrents/test
ls -la /mnt/torrents
Next, I set ownership and permissions for the folders so that it can be written to by all of services that will be running in docker. I run everything using the user created at installation.
The permissions are set so that the owner is 'handyadmin' and members of the group 'handyadmin' have read/write/execute permission and all other users have read/execute only access.
sudo chown -R handyadmin:handyadmin /mnt/books
sudo chown -R handyadmin:handyadmin /mnt/media
sudo chown -R handyadmin:handyadmin /mnt/temp
sudo chown -R handyadmin:handyadmin /mnt/torrents
sudo chmod -R 775 /mnt/books
sudo chmod -R 775 /mnt/media
sudo chmod -R 775 /mnt/temp
sudo chmod -R 775 /mnt/torrents
Make Subdirectories
I then made subdirectories for the different types of media I will be storing/hosting:
mkdir /mnt/media/holiday_movies
mkdir /mnt/media/movies
mkdir /mnt/media/music
mkdir /mnt/media/tvshows
Finally, I want to ensure all of these directories have the correct permissions:
Delay Docker Start
One important thing to note is that since I use NFS shares, I need docker to wait for the shares to mount before docker starts. Otherwise this will cause issues with the containers if they start before the shares have mounted.
I edited the systemd docker service file:
And then added this to the file:
[Unit]
Requires=mnt-books.mount
Requires=mnt-media.mount
Requires=mnt-temp.mount
Requires=mnt-torrents.mount
After=mnt-books.mount
After=mnt-media.mount
After=mnt-temp.mount
After=mnt-torrents.mount
A Requires and After line should be added for every NFS mount that a docker container will rely on.