Install Gallery3 Photo Album Organizer In Ubuntu


Gallery3 is an open source photo sharing web application based on apache and php. You can use is with your website and it comes with greater uploading option and enhanced performance.


  • Ubuntu 14.04 OS
  • Apache Latest Version
  • php latest version
  • Mysql Database Latest


Step1: Install apache2

apt-get install apache2


Step 2: Install Mysql-Server

apt-get install mysql-server

Provide  password to mysql (our is P@ssw0rd)

Step 3: Install php with supporting packages

apt-get install php5 php5-mysql php5-gd


Step 4: Create Database:

For Gallery3 to work properly we have to create a database:

Login with root password is ‘P@ssw0rd’

mysql -u root -p


Create a New  database with name gallery3, provide required credentials, password for this newly created database is ‘password’.

mysql> CREATE DATABASE gallery3;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL ON gallery3.* TO gallery3@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

mysql> \q

 Step 5: Download latest version of Gallery3 package.



Step 6: Configure Web Server:

mv /var/www/html/
cd /var/www/html/

Decompress the contents of

unzip && ls


Change ownership for gallery3 directory:

chown -R www-data /var/www/html/gallery3/

Step 7: Edit php file and set up the required credentials:

Open php file /etc/php5/apache2/php.ini:

vim  /etc/php5/apache2/php.ini

Change short_open_tag = Off to short_open_tag =On.

sample output:

engine = On
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
short_open_tag = On

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision = 14

; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; Turning on this setting and managing its maximum buffer size can yield some
; interesting side-effects depending on your application and web server.
; You may be able to send headers and cookies after you've already sent output
; through print or echo. You also may see performance benefits if your server is
; emitting less packets due to buffered output versus PHP streaming the output
; as it gets it. On production servers, 4096 bytes is a good setting for performance
; reasons.

Restart Apache Service.

/etc/init.d/apache2 restart


You are almost done, now open web browser, and type:


In our scenario it  will be:


Provide mysql Database password, Click Continue.


Click on Start using Gallery, A welcome Window will appear which will ask to change email id and password, set up as per your requirement.


Provide Information and password.


Now Go to add and try to add some Photographs, they will  get loaded at surprisingly fast speed.


Sample Images uploaded with gallery3:


That’s it, Have fun:

Reference links: