Piwigo container resetting volume permissions

I just recently started using the piwigo container put out by linuxserver.io on my Synology NAS. I noticed that whenever I restart the container, the permissions on the share folders that are mapped as volumes to the container always get their permissions reset so only the NAS’s administrators group & my NAS admin account have access to the folders.

The share is named “Forum Pics”, and it’s permissions are for the “Share - Forum pics” & “administrators” groups to have access. I’ve propagated those permissions down to all subfolders & files of the share (ie…piwigo pics & piwigo_virtual_upload"). However, whenever the container starts…it resets “piwigo pics” & “piwigo_virtual_upload”) to “adminstrators” & my admin account.

It also does the same thing to another share & subfolder that I map as a volume to the container.

Anyone ahve any idea why it’d be doing this? I dont like how a container is resetting my folder permissions.


bumpity bump…

Are you talking about the /config folder? If so, it will be owned by the PUID and PGID that you enter in environment variables

nope. I"m talking about the actual volume folders on my NAS that get mounted to the container as volumes.

I have other containers running with my local admin’s PUID & PGID pointed to other volume shares…and those containers don’t mess with the access permissions at all.

You need to provide more information on how you setup the container on your NAS. Screenshots etc etc.

ALL of the mounted volumes get their permissions messed up whenever the container restarts.


that’s because everything under /config mount needs to be owned by the container. It’s part of the start up routine.



ooh really? dang, that I didn’t realize. Makes sense now that ya put it that way. (sorry @aptalca…what ya had said didn’t click in my head!)

is there a way to do a sym link or something for /gallery to point outside of config…which I can have mounted to those volumes?

sure, for instance, you can mount the plex one as /plex inside the container

Then in /config/www/gallery, create a symlink that points to /plex

1 Like

okies. by chance…do you know how to do that on a Synology NAS? I’m far from being a linux/unix/*nix guru, or even knowledgable in it. But I can get around putty & all.

in synology command line, exec into the container via ssh by
docker exec -it piwigo bash
then do ln -s /plex /config/www/gallery/plex


<<d*mn character limit>>

gots another question for ya…
is the way piwigo starts up & taking ownership of the /config mount specific to piwigo? My other containers in docker don’t do that…the mounted volumes retain the permissions I’ve set on them.

All linuxserver containers fix permissions in their config folders. That is required for the apps inside to function properly

just wanted to update…finally got around to doing this. that symllink worked like a charm. Thx again @aptalca!

I stuck at a similar problem:
Piwigo container: latest

Docker in Syno NAS. Managed by Portainer.

  1. Piwigo is running
  2. Able to import manually photos
  3. volume /gallery is mounted in the docker setup (as is defined in your container description)
    let say:
  • /volumeX/docker/piwigo/gallery
  • /gallery
  1. I have centralised smb for photos. Let say

  2. symlink created by:
    `mount --bind ‘/volumeX/photo’ ‘/volumeX/docker/piwigo/gallery/galleries’
    also added into rc.local (to avoid symlinks lose after NAS restart)

  3. As expected, works. All photos are available at the ‘/volumeX/docker/piwigo/gallery/galleries’ folder

  • seen from the NAS
  • seen from Portainer/container console. The owner of the files/subfolder is ‘nginx’.

So what about sync into Piwigo DB?
7. Sync from Piwigo Admin/Tools/Synchronize

A. Expected behaviour: sync of ‘.galleries’ folder … follow the screenshot:

WARNINGs (below)

  • 0 albums added in the database
  • 0 photos added in the database
  • 0 albums deleted in the database
  • 0 photos deleted from the database
  • 0 photos updated in the database
  • 0 errors during synchronization

opendir(./galleries): failed to open dir: Permission denied in /gallery/admin/include/functions.php on line 608
line 606:if (is_dir($path))
line 607: {
line 608: if ($contents = opendir($path))

seems to be a problem with the path

line 70: if (is_dir($path) && $contents = opendir($path) )

seems to be a problem with the path

all mounted folders/files contain only defined characters. to be sure

Thx for a help