Piwigo on Nethserver 7

Piwigo is an open-source web photo gallery application running under PHP and MySQL. As with many such applications, it can be easily installed on Nethserver. Here’s how:


Piwigo requires a web server, PHP (at least version 5.3), MySQL (at least version 5), and strongly recommends ImageMagick. All of these except for ImageMagick can be installed using the Software Center in the server manager. To install ImageMagic, SSH in to your Neth server and run yum install ImageMagick.

If you want Piwigo to be in its own virtual host, create that now. Disable FTP access, and set the other options as appropriate for your installation.

For better performance, you can use a more recent version of PHP. To do that, follow the instructions to install PHP Software Collections, and then set PHP 7.2 for the virtual host where you’ll be installing Piwigo.

Create the database

While you’re logged in via SSH, you’ll need to create a database for Piwigo. Take the following steps:

# mysql
mysql> create database piwigodb;
mysql> grant all on piwigodb.* to piwigouser@localhost identified by 'SuperStrongPassword';
mysql> flush privileges;
mysql> exit

(obviously, replace SuperStrongPassword with a secure password of your own choosing).

Install Piwigo

Change to the directory where you want to install Piwigo. If you’re placing it in its own virtual host, that will be in /var/lib/nethserver/vhost/vhost_name. If you’re placing it in the default virtual host, you’ll use a directory in /var/www/html/. Note that the installer will create a subdirectory of /piwigo in the installation directory.

Download the Netinstall script:

curl "http://piwigo.org/download/dlcounter.php?code=netinstall" > piwigo_install.php

Then, using your web browser, browse to that file. You’ll see this page:

Click the Retrieve and unzip button. You’ll then see this:

Surprise surprise, you’ll click Install Piwigo now. You’ll then see this page:

The fields should be self-explanatory. Once you’ve completed the form, click Start Installation. You’ll then see this page:

Installation is complete.


As noted above, the Netinstall process creates a subdirectory of /piwigo wherever you run it, which means you’ll need to add that to the URL. To automate this, create a file called index.html with the following contents:

<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=piwigo/">
  window.location.href = "piwigo/"
<title>Page Redirection</title>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='piwigo/'>link</a>.


  • As noted above, the Netinstall process creates a subdirectory of /piwigo wherever you run it, which means you’ll need to add that to the URL. It’d be pretty simple to prepare an index.html file to take care of a redirect.
  • Investigate using the LDAP Login plugin

Congrats @danb35 !!
The fastest HowTo I can remeber !! :+1: :smile:

Thanks, but in this case it’s a pretty straightforward web app, and the installation process is pretty much the same as many others:

  • Create a database
  • Drop the files in a web-accessible directory
  • Fill in the details on a web form

But it looks like it’ll make for a nice gallery app.

1 Like


Whaouh… @danb35, I don’t know what to said to show how great is this how to ( more when we know the delay).

Really thank you, for your work, and simply to be heremin this comunity, on this forum.

If I was in the @alefattorini place, I will make a special and crazy badge only for you :wink:

Check his profile. He has already a loooot of badges :slight_smile:
But he deserves another one like this.


1 Like

bumping this topic. I just installed piwigo on my homeserver. Tried to configure AD/LDAP but couldn’t figure that one out… anyone care to have a look?

For the rest: works like a charm…

I managed to get it to work for OpenLDAP by installing the piwigo “Ldap Login” plugin, and using the following plugin settings (everything not mentioned below is emtpy):

LDAP server connection:

  • LDAP server host:
  • Secure connection (ldaps): checked

Ldap attributes:

  • Server mode: OpenLDAP
  • Base DN: dc=directory,dc=nh
  • Attribute corresponding to the user name: uid

Ldap Group attributes

  • Class of group: posixGroup
  • Attribute for members in group: memberUid

Ldap Login fails if the password contains certain special symbols, e.g. \.


Thanks for that information! I have gotten as far as binding and authenticating a user but I a struggling with the config for group membership. I have a local OpenLDAP server installed on Nethserver and have a group called “piwigo” with a few members but cannot seem to figure out the group membership parts. When I use the test function I get “Credentials OK, Check GroupMembership for: uid=dave,ou=People,dc=directory,dc=nh”

Thoughts? Thanks in advance, the LDAP features are useful but challenging. I am slowly working on making Nethserver the core of my identity management

Hi all,
I managed to download the piwigo_install.php, but when I run it I get:

# Piwigo encountered a non recoverable error **No PHP extension installed for mysql, Piwigo needs one**

in the browser. Anyone any idea?

Is this for the same version of piwigo as 1,5 years ago? If not, look at the pre requisites for the latest version of piwigo (higher version of php)
You probably need to use php-scl module to get a higher version of php available on NethServer.

you need to install all related php rpm to manage a sql database, check the manual of piwigo, it should be written somewhere

for rh-php73 I am talking of rh-php73-php-mysqlnd, rh-php73-php-pdo

hi Rob and Stephane,

Thanks for the replies.

I managed to get it working, using/installing the php scl module. Then I enabled in the Netheserver’s control panel Php Settings/Php Apache version the latest availavble (Php74 SCL Version).
Installer run fine w/o a problem, just had to enter the db settings (which I created previously, command line, in mysql) and settings for a new piwigo login/user.

If anyone want to take a peek at the commands I used, here they are:

yum install http://mirror.de-labrusse.fr/NethServer/7/x86_64/nethserver-stephdl-1.0.11-1.ns7.sdl.noarch.rpm
yum install nethserver-shellinabox --enablerepo=stephdl
yum update --enablerepo=stephdl
yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum install nethserver-php-scl --enablerepo=stephdl,remi-safe

alternatively you could use the virtualhost menu of cockpit, actually it allows php54, php72, php73

I still do not know If I propose a cockpit version of my rpm

Hi Stephane,

Regarding the rpm collection you made, after install I noticed there’s some considerable Installed size of 193M. Besides, PHP versions 5.6 7.0 and 7.1 are already marked as EOL.
From a security perspective, should I update periodically using this: yum update --enablerepo=stephdl, or something else?
Could you please advice on that?

remi maintains this repository it is not me (remi-safe), I propose a lot of rpm, yes, but the update is automatic and if you do not use php71 for example it is safe, but if a vhost uses it then you can upgrade to php74. If obviously the web application is compatible with this version of php