1. Home
  2. Linux

How to setup the Lychee Photo management tool on Linux

The Lychee Photo management tool is a piece of web software for Linux that allows users to efficiently, remotely manage their digital photos on the local network, much like we see with proprietary tools like Google Photos, iPhoto, and others. It’s mainly targeted at server grade distributions, but it’s possible to use this software on any old Linux OS as long as it’s always online.

In this tutorial, we’ll go over how to install and set up the Lychee photo management system on Linux. Install Ubuntu server and follow along with our guide to learn how to get it going!

Note: please do not attempt to use Lychee unless you have at least two cores and 4GB of RAM!

Before we begin

The Lychee Photo management system works on any Linux OS that can run as a server. With that said, this tutorial will focus on setting it up under Ubuntu server. We choose Ubuntu as it’s easy to understand, and is one of the better Linux server OSes out there. However, if you’re not a huge fan of Ubuntu server, feel free to follow along with this guide anyways. The installation instructions are the same, minus differences in package names.

Download Lychee

You must download the Lychee photo management tool from the internet before you can use it, as there are no Ubuntu-specific packages for the software. To download the software, you’ll need to interact with GitHub via the Git package. Open up a terminal and install the latest version of the Git tool on your Ubuntu server.

sudo apt install git

With the Git tool set up, gain a root shell using the su or sudo -s command.

su -

or

sudo -s

Using the CD command, move the terminal session from the home directory into the /var/www/html/ folder. Be sure that you do not create a new Lychee folder! Git will create the new folder during the download process.

cd /var/www/html/

Clone the code using the git clone command.

Note: having trouble with Git? Feel free to download the Zip archive of Lychee to your Ubuntu server instead!

git clone https://github.com/electerious/Lychee.git

Update the Lychee code folder’s permissions. Please read the chmod command below carefully! Permissions must be set to 750, and not 777. If they’re not set exactly right, Lychee will not run correctly!

cd Lychee
chmod -R 750 uploads/

chmod -R 750 data/

Set up SQL database

The Lychee software is on your Ubuntu server. However, Lychee will likely fail to run if you access it as it has no SQL database set up yet. To set up an SQL database, open up a terminal and follow the steps below.

Step 1: Install the LAMP server package on Ubuntu server and get MySQL set up.

su -

or

sudo -s
apt install lamp-server^

Step 2: Run the MySQL secure installation process and configure the database software for Ubuntu server.

mysql_secure_installation

Step 3: Using the SQL Root account, log into the MySQL command-line interface.

mysql -u root -p

Step 4: Make a new database for the Lychee photo management system.

create database lychee;

Step 5: Create a user for the Lychee software to interact with MySQL. Be sure to change ‘Password’ to your desired SQL database password.

GRANT ALL PRIVILEGES ON lychee. * TO lycheeadmin@'localhost' IDENTIFIED BY 'Password' WITH GRANT OPTION;

Step 6: flush the privileges for MySQL.

flush privileges;

Step 7: Log out of the MySQL command-line database.

PHP add-ons

We’ve set up LAMP (Linux Apache MySQL and PHP,) but we’re not done, as the PHP add-on packages that Lychee needs are not installed on Ubuntu. To install them, open up a terminal window and use the Apt package manager.

sudo apt install php7.2-*

The command above should set up all necessary PHP add-ons for your system. If you’re having issues, please refer to the official Lychee documentation page.

Apache configuration

The last step in the installation process is to set up Lychee as a site in the Apache2 web server. Open up a terminal and use the touch command to create a new config file.

su -

or

sudo -s

touch /etc/apache2/sites-available/lychee.conf

Open up the new configuration file in the Nano text editor.

nano /etc/apache2/sites-available/lychee.conf

Paste the code below into Nano and press Ctrl + O to save it. Be sure to look over the code and change it to suit your needs.

VirtualHost *:80>
ServerAdmin admin@domainnamehere.com
DocumentRoot /var/www/html/Lychee/
ServerName domain.com
ServerAlias www.domain.com
<Directory /var/www/html/Lychee/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/domainname.com-error_log
CustomLog /var/log/apache2/domainname.com-access_log common
</VirtualHost>

Access your Lychee photo management system at:

http://ip-address-of-server/Lychee

When the WebUI loads up, you’ll need to fill out the SQL user and password. For the username, enter lycheeadmin. For the password, enter the SQL password you set earlier.

With the SQL information set, you’ll have access to your new private photo management system.

Leave a comment