Installation Docker
Docker install requirements
This guide assume you can connect to your server via ssh and already have installed docker, if that's not the case follow the official docker documentation
Step 1 - Installing the container
Connect to your server and create a folder named Piwigo then download the compose.yaml from the Piwigo/piwigo-docker repository inside it.
You can use curl to download compose.yaml without leaving the terminal :
Create a file named .env with the following :
Tip
You can use the following command to generate a valid password :
Start your container with : docker compose up -d.
You can read the logs with docker compose logs.
Step 2 - Configure the reverse proxy
It's advised to use the piwigo container behing a Reverse proxy like NGINX
Info
Piwigo supports being hosted on a domain, subdomain, and/or subpath; whatever you choose, it's advised to not use the Piwigo release number in the URL.
You can use the following Nginx config examples :
If you changed piwigo_port in .env you will also need to modify the proxy_pass section to reflect that.
Keep in mind that Docker will ignore all your firewall rules by design.
f you intend to host Piwigo on a subpath like my_domain.tld/gallery, you will need to forward it to the container by adding proxy_set_header X-Forwarded-Prefix /gallery
server {
listen 80;
server_name my_domain.tld;
location /gallery/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /gallery;
}
}
Step 3 - Configuration
Once the container is started and your reverse proxy is configured, open a web browser to the web address you are hosting Piwigo on. Piwigo will detect nothing is installed yet, and redirect you to the installation page
Fill in MySQL database connection settings with the following :
- Host :
piwigo-db:3306 - User :
piwigodb_user - Password : Use the password you wrote in the
.envfile - Database name :
piwigodb - A prefix for Piwigo table names :
piwigo_
The following is required to create the webmaster account :
- An account identifier, chosen by you
- A password you have to enter twice, for checking
- Your email address, so that visitors can contact you
Run the “Start Install” action.
You will be informed about either success or failure of the installation process.
Step 4 - First connection
Once the installation is finished, you can go into your gallery. Login with your webmaster account, and you can reach the administration panel.