Piwigo on OpenMediaVault

piwigoAndOMV

Today, I am taking Techno Dad Life (TDL) challenge. I am going to attempt to install Piwigo an open source photo management server on my OMV. I am going to assume that TDL’s challenge is to use Docker container. I am going to update this post and make it look a bit more organized in a few days. I just need to get this info out for TDL video.

So here we go now!

I just want to address the PUID and PGID. Please see this post https://www.networkshinobi.com:443/docker-containers-puid-and-pgid/ regarding PUID and PGID.

SSH to the OMV server and create two directories. One for Piwigo and the other for mariadb. If you have not created a directory named appdata, this is the time to do so. The command mkdir -p will make the directories that have not existed along the path

root@openmediavault:~# mkdir -p /sharedfolders/appdata/piwigo
root@openmediavault:~# mkdir -p /sharedfolders/appdata/mariadb-photo
root@openmediavault:~# cd /sharedfolders/appdata
root@openmediavault:/sharedfolders/appdata# ls -lh
total 8.0K
drwxr-xr-x 2 root root 4.0K Jun  6 20:16 mariadb-photo
drwxr-xr-x 2 root root 4.0K Jun  6 20:16 piwigo
root@openmediavault:/sharedfolders/appdata#
  1. Assuming you already installed the Docker UI on your OMV, navigate to Services > Docker
  2. Search for piwigo in the search box. If there are multiple ones, select the one from Linuxserver repository
piwigodockerui
Figure 1

Click Start to pull the Piwigo image from Docker Hub. Once the Close button is clickable, click the Close button.

note_rectangle

The time it would take to pull an image depends on its size and your Internet speed.

piwigopull
Figure 2

Search for mariaDB and make sure that it is from Linuxserver repository as shown in Figure 3.

piwigomadiadbpull
Figure 3

Again, click on Start to pull the mariaDB Docker image. Click Close, when it is done downloading.

piwigomadiadbpull
Figure 4

Verify the Docker images by clicking the Refresh button

piwigodockeruirefresh
Figure 5

Now we need to configure the Docker containers. We are going to start with mariaDB. Click on mariadb image then click on Run Image.

Figure 6

Under the General Settings section, fill out the following fields as shown in the table below. See Figure 7 for reference.

note_rectangle

You can give your container any name you want, but in my use case, I may install a new container that requires a database; therefore, I named mine mariadb-photo, so that if I need to, I could create a new database instead of spinning up a new one.

Container namemariadb-photo
Restart Policyalways

Under the Networking, Port forwarding section, enter the following as shown in table below. Make sure click on the + sign to add the config. See Figure 7 for reference.

Host IPHost PortExposed Port
0.0.0.033073306/tcp
Figure 7

Under the Environment variables section, add the following as shown in the table below. Check this link for databse timezone. See Figure 8 for reference.

note_rectangle

Adjust the TZ to meet your own Timezone. Timezone is very sensitive; if this doesn’t match your other containers, you are going to have a bad day. also, for PUID and PGID value, you can use your admin or whoever managing your Docker containers.

For example: in the terminal, type in id <your-username>

NameValue
TZAmerica/New_York
MYSQL_ROOT_PASSWORDStrongPasswordHere
PUID99
PGID100
Figure 8

Under the Volumes and Bind mounts section, locate the directory mariadb-photo we created earlier. See Figure 9 for reference.

Figure 9

Under the Volumes and Bind mounts section, the Host path and Container path should look like as shown in the table below. Click Save to start the mariadb container. See Figure 10 for reference

Host pathContainer path
/sharefolders/appdata/mariadb-photo/config
Figure 10

If you disconnected your SSH session earlier, you will need to SSH again to your OMV server. We are going to configure the mariadb and create a database for Piwigo.

# We need to bash-in mariadb container
root@openmediavault:~# docker container exec -it mariadb-photo bash
root@06b18968d2fe:/# 

# As you can see above, the prompt changed from root@openmediavault to
# root@06b18968d2fe. This tells us that we are inside of the container.
#
# We are going to create the piwigo database. Please replace the username 
# 'piwigo' with your desired username. Same with the database 'piwigo'.
# Also, generate a better password than what I have in this example. 
mysql -u root -p
# You will get prompted with the mariadb password we set-up in the web UI

# Create a user 'piwigo' with a password of 'StrongDatabasePassword'
CREATE USER 'piwigo' IDENTIFIED by 'StrongDatabasePassword';

# Create a database for piwigo
CREATE DATABASE IF NOT EXISTS piwigo;

# Grant all privileges 
GRANT ALL PRIVILEGES ON piwigo.* TO 'piwigo' IDENTIFIED BY 'StrongDatabasePassword';

# Exit mariadb
quit

# Exit mariadb container
exit

Back to OMV web UI. Navigate back to Services > Docker > Docker images. we are going to run the Piwigo image that we pulled earlier. Click on Piwigo Docker image then click on Run image

Under the General section, fill out the following fields:

Container namepiwigo
Restart PolicyAlways

Under the Networking section, and fill out the following fields. Don’t forget to click on the + plus sign. When done, scroll down for more settings.

note_rectangle

OMV uses port 80/tcp. Thefore, the Host Port has to be changed. You can choose any port you desired for Host Port. However, choose the port that doesn’t overlap with your other containers’ Host Port.

Host IPHost PortExposed Port
0.0.0.08280/tcp
Figure 11

Under the Environment variables, add the following information as shown in the table below. See Figure 12 for reference.

Note: Adjust the value based on your own use case

NameValue
TZAmerica/New_York
PUID99
PGID100

Under the Volumes and Bind mounts, fill out the following. Do not forget to click on the + sign. Click Save to start the Piwigo container. See Figure 12 for reference.

note_rectangle

The second line /config/www/gallery/upload/ is optional. I only did this so that my photos are located outside of the appdata. Therefore, if I decided to switch to a different platform. I have my photos outside of Piwigo.

Host pathContainer path
/sharefolders/appdata/piwigo /config
/sharefolders/Photos/piwigo /config/www/gallery/upload/
Figure 12

Open a new browser tab and navigate to http://omv-ip-addr:82. You will be greeted by the Piwigo installation page.

Basic Configuration
Default gallery languageEnglish [US]
Database configuration
Host10.0.7.123:3307
Userpiwigo
PasswordStrongDatabasePassword
Database namepiwigo
Administration configuration
Usernamekarlo
Passwordweb-ui-admin-password
Confirm Passwordweb-ui-admin-password
Email addressyour-email-address
Figure 13

If everything is configured correctly, you should get the page similar to Figure 14.

Figure 14

You can either Start the tour or skip it. It is your choice and choose wisely 🙂

Figure 15

This is it. This is the admin gallery page. You can start configuring your instance of Piwigo.

Figure 16

Cheers!

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
gett
gett
4 years ago

Thank you for useful tutorial.
One question, please: In which folder are pictures: /sharefolders/Photos/piwigo or
config/www/gallery/upload/ ?
P.S.
Did Techno Dad send you a sticker? 🙂

1
0
Would love your thoughts, please comment.x
()
x