Lychee, simple and selfhosted web photo management

One of the first thing I’ve been self hosting on my own server was a web photo gallery to let my family, friends, etc… follow some moment of my life, in photo. Facebook and co have never been my taste, as it is clear how they use our data and sell our privacy.

So I wanted to have my own gallery on my own server and at that time, I used Piwigo (I’ve already wrote an article about it) and I keep using it. But if Piwigo does not suit your needs (Want some simpler, etc..) Lychee might be your taste!

Lychee is a free and open source photo management app, to be run on your server. Easy to install (Only require LAMP), it will let you upload, manage and share your pictures in an easy manner.

Lychee main screen

It supports the XIF and IPTC Metadata and allow you to upload pictures from your computer, but also directly an URL or even from a Dropbox account.

You can have a look to their demo to have a first impression.

Interested to use? Let’s see how to install it!



You will need PHP and MySQL installed on top of a web server (Apache and co). If you don’t have, just check this tutorial.

1) Install the requisites

Lynchee requires the PHP extension exif, gd, json, mbstring, mysql, zip. To install them, simply run: (In root or with sudo)

apt-get install php5-cli php5-gd php5-common php5-mysql

2) Clone their latest release into your /var/www folder

Still in root, run:

cd /var/www
git clone

3) Change the owner of the folder to the Web server user (www-data)

chown -R www-data:www-data /var/www/Lychee

4) Go to the web installer and follow the steps

http://YourIP/Lychee should point to the web installer

You will need to set few things:

– Database credentials

If you use MySQL, I can use PHPMyAdmin to create a dedicated database for Lychee.

– User account and password

When done, you will have a fully working Lychee photo management app, ready to upload all your pictures/photos and share them.

If like me, you wish to extend the upload size (2mb per default with PHP) and want to be able to upload big files in a batch, you will need to change couple of php.ini values or create a dedicated virtualhost with those values in it.

As I want to be able to access to my gallery using a dedicated domain name (Or sub domain) and force the SSL connection, the vhost solution is the must.


Virtualhost configuration

What you will need:

1) Create a A redirection in your DNS server/registrar with lyc.domain.tld to your IP

2) Have SSL certificate ready. If not you can read this tutorial. (Optional)

3) Create your virtualhost as following:

In /etc/apache2/sites-enabled/, create a file called lychee (In root):

nano /etc/apache2/sites-enabled/lychee

and paste the following content:

<VirtualHost *:80>
        ServerAdmin webmaster@domain.tld
        ServerName lyc.domain.tld
        Redirect / https://lyc.domain.tld

<IfModule mod_ssl.c>
<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/myblog.pem
        SSLCertificateKeyFile /etc/ssl/private/myblog.key

        ServerAdmin webmaster@domain.tld
        ServerName lyc.domain.tld

        DocumentRoot /var/www/Lychee
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        <Directory /var/www/Lychee>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

       php_value max_execution_time = 200
       php_value post_max_size = 200M
       php_value upload_max_size = 200M
       php_value upload_max_filesize = 20M
       php_value max_file_uploads = 100
       php_value memory_limit = 256M


Adapt the content (Servername, webmaster email, SSL certificate, directory and PHP Values).

When done, save the file (CTRL+X then Yes) and reload apache: (In root)

/etc/init.d/apache2 reload

Lychee should now be accessible through lyc.domain.tld, forcing HTTPS connection and allowing you to upload bigger file size.


Loves to discover web-based apps to install on his own server@home and write articles about it


Add a comment