How to Install PiGallery 2 on Your Synology NAS

How to Install PiGallery 2 on Your Synology NAS

PiGallery 2 is a fast (like faster than your PC fast) directory-first photo gallery website, optimized for running on very low resource servers. PiGallery 2 is very simple to use. Point to your photos folder and to a temp folder and you are good to go. In this step by step guide I will show you how to install PiGallery 2Ā on your Synology NAS using Docker and Portainer.

šŸ’”Note: This guide works perfectly with the latest PiGallery 2 v2.0.0Ā release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

InstallĀ Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Go toĀ File StationĀ and open the docker folder. Inside the docker folder, create one new folder and name itĀ pigallery2. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

PiGallery 2 Synology NAS Set up 1

  • STEP 4

Now create four new folders inside the pigallery2 folder that you created at STEP 3 and name them config, db, image, tmp. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

PiGallery 2 Synology NAS Set up 2

  • STEP 5

Populate the image folder that you have previously created at STEP 4 with your own photos.

  • STEP 6

Log into Portainer using your username and password. On the left sidebar in Portainer, click on StacksĀ thenĀ + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 7

In the Name field type in pigallery2. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: "3.9"
services:
  pigallery2:
    image: bpatrik/pigallery2:latest
    container_name: PiGallery2
    hostname: pigallery2
    mem_limit: 6g
    cpu_shares: 1024
    security_opt:
      - no-new-privileges:true
    read_only: true
    user: 1026:100
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:8080
    ports:
      - 9842:8080
    volumes:
      - /volume1/docker/pigallery2/db:/app/data/db:rw
      - /volume1/docker/pigallery2/config:/app/data/config:rw
      - /volume1/docker/pigallery2/image:/app/data/images:ro  # Point to your photos folder
      - /volume1/docker/pigallery2/tmp:/app/data/tmp:rw
    environment:
      NODE_ENV: production
      PORT: 8080
    restart: on-failure:5

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.

PiGallery 2 Synology NAS Set up 3

  • STEP 8

Scroll down on the page until you see a button namedĀ Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

PiGallery 2 Synology NAS Set up 4

  • STEP 9

If everything goes right, you will see the following message at the top right of your screen: ā€œSuccess Stack successfully deployedā€œ.

PiGallery 2 Synology NAS Set up 5

  • STEP 10

Go back toĀ STEP 1Ā or you will deal with karma šŸ™‚

  • STEP 11

The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection. Now open your browser and type inĀ http://Synology-ip-address:9842 Type in the default username and password, then click Login. Follow the instructions in the image below.

āš ļøWarning: the default username is adminĀ and the default password is admin

PiGallery 2 Synology NAS Set up 6

  • STEP 12

At the top right of the page, click on the 3 vertical lines then Settings. Add a new user with Admin privileges, then save the settings. After that, remember to log out, then log in using your new admin credentials. Only after logging in with the new credentials will you be able to remove the old admin/admin user.

PiGallery 2 Synology NAS Set up 7

  • STEP 13

Your PiGallery 2 at a glance!

PiGallery 2 Synology NAS Set up 8

Enjoy PiGallery 2!

šŸ†˜TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issuesĀ article.

Note: If you want to run the PiGallery 2 container over HTTPS, check How to Run Docker Containers Over HTTPS. In order to make PiGallery 2 work via HTTPS, it’s mandatory to activate WebSocket.

Note: Can I run Docker on my Synology NAS?Ā See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find outĀ how to update the PiGallery 2 container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Tuesday / June 11th, 2024 at 10:08 AM