Make nextcloud folder visible for plex | docker is involved

Hi!
I am not an expert in this stuff, but i try my best to explain the problem.
This might not be the right place to ask this question. But usually there are some smart people here to help. So i try it anyway :slight_smile:

I would like to make my plex movie directory see my nextcloud movie directory. This would be a very convinient way to utilize storage and keep data up to date.

The current issue seems to be permission based.

My initial approach is described here. It simply uses a softlink

ln -s /path/to/read/file.mp4 /path/to/plex/movies

Now i can see my NC files within the plex directory via my shell. But plex still can’t read them. This should be a permission issue, so i used the hint in the source above:

usermod -a -G www-data plex

The problem here is, that plex it not a known user.
grafik

Since both services run in seperate containers, i thougth the plex user is only visible within the container. I used exec to enter the plex container but couldn’t find the plex user there either.
This is the command i used to check for users:

cut -d: -f1 /etc/passwd

So i figured, that if i find the users that have access to the plex movie directory on my drive, i could just add this user to the www-data group. But it found no special user permission:
grafik

And when checking my plex docker-compose file:

---
version: "2.1"
services:
  plex:
    image: ghcr.io/linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=33  
      - PGID=33 
      - VERSION=docker
    volumes:
      - /home/xxx/plex/config:/config
      - /hive1/plex_media:/media
    restart: unless-stopped

i was surprised to see the entry 33 under environment. It seems to be referencing to the group www-data. So i would think that plex should already be some sort of part of group www-data?

I really don’t know much about this stuff and i only work with this as a hobby. Maybe someone can give me a hint on things i don’t understand or even someting that might help me fix this.
Either would mean a lot to me :slight_smile:

I don’t understand why you are using a symlink, why not just mount the plex volume into the path of your Nextcloud movie folder on your disk.

I have a similar use case but with images and Jellyfin (Open Source Plex Alterative) and docker just does it’s magic with the permissions. That doesn’t mean there isn’t a potential permission issue I have never run into, but I would first try to rule out or determine the symlink as the issue.

I already tried this approach but ran into other permission issues i couldn’t solve.

Ok, because there are many thing i don’t know about your setup I have no clear solution for you. Just remember, that user groups inside the docker are not the same as on the host. So as long as the docker service has access to them on the host the users inside the dockers should have access too.

If I am guessing correctly that the root@nexus shell in your image is outside the dockers (=on the host) I wonder why there even is a www-data user ? That should only exist inside the docker, which runs as root.

If I am guessing correctly that the root@nexus shell in your image is outside the dockers (=on the host) I wonder why there even is a www-data user ?

Exactly! Thats what i was wondering about as well. I used this guide to create my nextcloud setup a few years ago, but there is nothing that mentions directly something about creating another www-data group.
But there is one thing under the headline “5.3.Creating And Starting Containers” where i change the permissions on my local nextcloud data volume:

chown www-data:www-data data

However, when mounting a host path to a volume in the container, the permissions on the file system will apply in the container. So if a folder needs to be owned by www-data in the container, and it’s owned by root or some other user on the host, the program in the container will get access denied errors. So the folder on the host must have correct permissions for the container, even if the user doesn’t actually exist on the host and it’s just the UID/GID.

If you don’t have a www-data user/group on your system, you can use the numerical UID/GID and it should still work, even if it doesn’t exist on the host.

And did you run that inside the container or on the host ? (container would be the right way)

Sorry i was traveling up until now and had no opprotunity to answer.
Thank you very much, this was the missing clue!