Pages: 1 2
Linux Mint Cinnamon
Piwigo 16.3 (Docker)
USB3 Ext HD
Has anyone been able to get Piwigo 16.3 (Docker) to use an external hard drive for the "galleries" folder, without errors ?
I have been able to get Piwigo to work with my external hard drive and recognize the folders and files in the ext drive,
however,,,, Piwigo itself does not work very well, l especially with admin features.
I was so unstable I had to reinstall Piwigo without the ext HD..
This is ok for testing, but I Have TBs of images and my system drive is not large enough to contain all the images.
SO, has anyone got this to work with the DOCKER version of Piwigo 16.3 ?????
Thanks
Anne
Offline
Hi again.
If you want to use another drive/folder for the galleries folder in piwigo you can edit the compose.yaml file and add another bind-mount in the volumes section of piwigo-main.
Assuming you have an external hard drive mounted at /mnt/ExternalHDD and you want to use the folder /mnt/ExternalHDD/MyPhotos as a galleries folder you can do the following : (please manually edit your compose)
networks:
piwigo-network:
external: false
services:
piwigo-main:
image: piwigo/piwigo:latest
restart: always
environment:
- TZ=${timezone}
networks:
- piwigo-network
ports:
- ${piwigo_port}:80
depends_on:
- piwigo-db
volumes:
- ./piwigo-data/piwigo:/var/www/html/piwigo/
- ./piwigo-data/scripts:/usr/local/bin/scripts/
- /mnt/ExternalHDD/MyPhotos:/var/www/html/piwigo/galleries
piwigo-db:
image: docker.io/library/mariadb:lts
restart: always
environment:
- MARIADB_RANDOM_ROOT_PASSWORD=true
- MARIADB_USER=piwigodb_user
- MARIADB_DATABASE=piwigodb
# Defined in .env
- MARIADB_PASSWORD=${db_user_password}
- TZ=${timezone}
networks:
- piwigo-network
volumes:
- ./piwigo-data/mysql:/var/lib/mysqlOffline
Hi RushLana, I did what you are suggesting and yes it allowed piwigo to access the HD, HOWEVER, it borked up piwigo ,, all kinds of stuff broke, like the admin button in the upper right corner failed with a divide by zero error, and the addon to synchronize no longer worked, could not access files, and a bunch of other things... I had to reinstall piwigo to get things fixed... However, I will try it again this weekend or sooner if I get the chance..
Anne
Offline
Hi,
Can you open an issue here ? https://github.com/Piwigo/piwigo-docker/issues
I didn't encounter any issue when using an USB key during my testing.
Offline
hi again..
2 Questions...
1. Can Piwigo (docker) use BOTH a local drive folder AND a ext drive folder, as the "galleries" folder ,,, at the same time ?
2. Can Piwigo (docker) use local drive folder "A" AND local drive drive folder "B", as the "galleries" folder, at the same time ?
OR,, can there only be (1) "galleries" folder location in use at one time ?
As to your request to create a ticket,
I will reinstall Piwigo (docker) once again from scratch to make sure "I" didn't mess up something trying to get things up and running with the external drive and folder,, and then create the report if it fails the same way again...
Anne
Offline
RushLana...... Got the chance to remove everything associated with Piwigo today, and then totally re-install the program... No more divide by zero errors...... or any of the other quirky things and errors I was getting before.... This new install pulled the 16.3.0c (Docker),... maybe something there,, or maybe I just made an error in the the things I tried when I was trying to get the external drive function to work .. BTW,,I had to add the galleries folder back to the path you posted to get it to work,, ,,,,,, /mnt/ExternalHDD/MyPhotos/galleries:/var/www/html/piwigo/galleries ... Is that OK, or am I getting it to work by doing something wrong ???
Offline
Hi Anne,
To answer your previous question, yes you can use an alternative folder to the "galleries" folder, it work exactly like it would on a non docker install.
The path I propose is an example, you should use the path where you external hard drive is.
You can find the exact path to your external HDD using lsblk or findmnt and may need to add rules in fstab to automount your drive.
Offline
RushLana, Thanks for the reply...
Really important question for my unique use of Piwigo.....
Can two (2) locations be used at the same time for the galleries folder,, ie.,
home/anne/Piwigo/piwigo-data/piwigo/galleries AND
home/anne/videos/old-training-videos/galleries
Situation,,
first location files on laptop install,
second location on another device
first location, files needed by all everyday are on laptop install,
second location, files on a different device, files used rarely
Hope this makes some sense of what I am trying to do....
Offline
Hi, you can probably use a subfolder
volumes:
- ./piwigo-data/piwigo:/var/www/html/piwigo/
- home/anne/Piwigo/piwigo-data/piwigo/galleries:/var/www/html/piwigo/galleries
- home/anne/videos/old-training-videos/galleries:/var/www/html/piwigo/galleries/Old-Training-Video
- ./piwigo-data/scripts:/usr/local/bin/scripts/it should work, if I have the time I can do more testing but I have more pressing issues to fix first.
Offline
Hi RushLana,
I have been testing adding other locations to the galleries folder, and I can not get it to work with 2 locations..
Every time I add another location, the location added becomes the only location detected, with all its files and folders,,
Did you have any success with your testing ??
Anne
Offline
Hi Anne,
I did a lot of testing today and couldn't reproduce your issue.
Can you send your compose.yaml ?
Mine for reference :
services:
piwigo-main:
image: piwigo/piwigo:latest
restart: always
environment:
- TZ=${timezone}
- PIWIGO_UID=${PIWIGO_UID}
- PIWIGO_GID=${PIWIGO_GID}
networks:
- piwigo-network
ports:
- ${piwigo_port}:80
depends_on:
- piwigo-db
volumes:
- ./piwigo-data/piwigo:/var/www/html/piwigo/
- ./galleries:/var/www/html/piwigo/galleries
- ./subgallery:/var/www/html/piwigo/galleries/subgal
- ./piwigo-data/scripts:/usr/local/bin/scripts/Keep in mind that the order is important, the parent folder should be before the sub-folder.
Offline
Hi RushLana,
Been extra busy, but I finally got time to send you the compose file....
Thanks for helping...
The compose file below makes media in /home/anne/Piwigo/xx/galleries:/var/www/html/piwigo/galleries the ONLY source
Each of the commented out lines, when added, make that location the ONLY location recognized for media
networks:
piwigo-network:
external: false
services:
piwigo-main:
image: piwigo/piwigo:latest
restart: always
environment:
- TZ=${timezone}
networks:
- piwigo-network
ports:
- ${piwigo_port}:80
depends_on:
- piwigo-db
volumes:
- ./piwigo-data/piwigo:/var/www/html/piwigo/
- ./piwigo-data/scripts:/usr/local/bin/scripts/
- /home/anne/Piwigo/xx/galleries:/var/www/html/piwigo/galleries
# - /mnt/12TB_Ext/PiwigoPhotos/galleries:/var/www/html/piwigo/galleries
# - /mnt/12TB_Ext/PiwigoMEDIA/galleries:/var/www/html/piwigo/galleries
piwigo-db:
image: docker.io/library/mariadb:lts
restart: always
environment:
- MARIADB_RANDOM_ROOT_PASSWORD=true
- MARIADB_USER=piwigodb_user
- MARIADB_DATABASE=piwigodb
# Defined in .env
- MARIADB_PASSWORD=${db_user_password}
- TZ=${timezone}
networks:
- piwigo-network
volumes:
- ./piwigo-data/mysql:/var/lib/mysql
Offline
Hi, anne.
I see the issue.
Docker uses bind-mounts to link directories, that mean only one directory can be mapped to another and only the last one matters.
You can't "merge" directories.
The best solution for you should be to use sub-folders, just append after /var/www/html/piwigo/galleries the name of the subfolder you want to use like I did in my previous comment ( see the subgalleries line ).
Offline
Hi RushLana,
OK, I guess I do not understand docker stuff enough,,, I do not know the why and how to get this to work.... I tried....
Could you please explain how your code works with an example..
.
Using two locations,, the first being the standard piwigo galleries location,
home-anne-Piwigo-piwigo-data-galleries, where galleries contains the album folders and the pics are in the album folders
and a second location ,,
home-anne-piwigomedia-galleries, where galleries contains the album folders and the pics are in the album folders
I can get either location to work but not oth at the same time AND when I switch locations, piwigo deletes the prior location data,, ( does not delete the actual data)
I am trying to learn, so if you would please explain the why and how of things
Thanks
Anne
Last edited by Anne-FORUM-PiWigo (2026-04-14 08:01:16)
Offline
Hi,
This not something that is only applied with docker but how mounting drives on Linux works.
When you had a volume field in your compose file, your system map a directory to another inside the container.
Let's take ./piwigo-data/piwigo:/var/www/html/piwigo/ for example.
It maps /piwigo-data/piwigo in your system to the target /var/www/html/piwigo/ inside the container.
The limitation is that you cannot map to the same target; if you try to, the system will only pick the latest directory.
To show how that works with an example :
I have Piwigo installed in my home folder, /home/lana/piwigo-data
I have an external hard drive mounted at /mnt/extHDD with 2 folders inside: "Family-Photos" and "Landscapes"
I want to mount my Pictures folder and the two folders in extHDD in the galleries folder inside piwigo-data so I edit my compose file to add those folders without having the same destination folder:
(Lines with # are comments)
volumes:
- ./piwigo-data/piwigo:/var/www/html/piwigo/
- ./piwigo-data/scripts:/usr/local/bin/scripts/
# I mount my Pictures folder as a galleries folder
- /home/lana/Pictures/:/var/www/html/piwigo/galleries
# I mount the external folders as sub-folders of the galleries folder
- /mnt/extHDD/Familly-Photos/:/var/www/html/piwigo/galleries/Familly-Photos/
- /mnt/extHDD/Landscapes/:/var/www/html/piwigo/galleries/Landscapes/Offline
Pages: 1 2