Getting Jellyfin and NextCloud on the same page

I see that you used the ACLs (+ at the end of the permissions). They seem quite powerful but I am not used to them.
I have also realized that giving Nextcloud access to all Jellyfin files and vice-versa is not really safe, so let’s use an intermediary group multimedia.
Let’s reset everything.

sudo su
# Let's remove the previous unsafe groups
deluser jellyfin nextcloud
deluser nextcloud jellyfin
# Let's create the group and add its users
groupadd multimedia
usermod jellyfin -a -G multimedia
usermod nextcloud -a -G multimedia
# Are you sure there is a upper case A in Ampache ?
usermod Ampache -a -G multimedia
# Set permissions
chown nextcloud:multimedia -R /var/Multimedia
find /var/Multimedia -type d -exec chmod 0775 {} \;
find /var/Multimedia -type f -exec chmod 0664 {} \;
# Set ACLs (I did some research :p)
# Users will get ownership of their own files,
# but the group will always be multimedia
# I left the r permission to other, but you can replace it with 0
# if you only want the apps listed above to access the files
setfacl -d -m u::rwX,g::rwX,o::r /var/Multimedia
# Restart services
systemctl restart nginx
systemctl restart php7.3-fpm
systemctl restart jellyfin

Then add the external mount /var/Multimedia into Nextcloud. Jellyfin should now have write access to the directory too.

3 Likes