How to Install Lychee on Manjaro

Lychee is a free open-source photo management tool that allows you to easily organize, share and backup your photos. In this tutorial, we will show you how to install Lychee on Manjaro.

Prerequisites

Before we begin, make sure that you have the following:

Step 1: Install Required Dependencies

Before we install Lychee, we need to make sure that all the necessary dependencies are installed on our system. To do so, open a terminal window and run the following command:

sudo pacman -S php php-gd php-intl php-pgsql postgresql imagemagick

This command will install PHP, PostgreSQL, and other required packages.

Step 2: Install and Configure PostgreSQL

Once you have installed PostgreSQL, you will need to configure it. To do so, run the following commands:

sudo -iu postgres
initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'
sudo systemctl start postgresql
sudo systemctl enable postgresql
psql -c "CREATE USER lycheeuser WITH PASSWORD 'lycheeuser';"
psql -c "CREATE DATABASE lychee WITH OWNER lycheeuser ENCODING 'UTF8';"

The above commands create a PostgreSQL user and database for Lychee. You can replace lycheeuser and lycheepassword with your desired values.

Step 3: Download and Install Lychee

To download and install Lychee, follow these steps:

  1. Download the latest release of Lychee from https://lycheeorg.github.io/.
  2. Extract the downloaded archive to the desired location. For example, /var/www/html/lychee/.
  3. Set the correct permissions for the Lychee folder:
sudo chown -R http:http /var/www/html/lychee/
sudo chmod -R 755 /var/www/html/lychee/

Step 4: Configure Lychee

Now that Lychee is installed, we need to configure it. To do so, follow these steps:

  1. Rename the uploads/big folder to uploads/big-dist.

  2. Rename the uploads/import folder to uploads/import-dist.

  3. Copy the uploads folder from the Lychee installation folder to /var/lib/postgres/data/lychee/.

  4. Copy the data folder from the Lychee installation folder to /var/www/html/lychee/.

  5. Create a copy of the config.php file and rename it to config_local.php. The config_local.php file will hold your custom configuration options.

  6. Edit the config_local.php file and configure the following options:

<?php
$dbHost = 'localhost';
$dbName = 'lychee';
$dbUser = 'lycheeuser';
$dbPassword = 'lycheeuser';

$lycheeUrl = 'http://localhost/lychee';

Make sure to enter the correct values for your Lychee installation and PostgreSQL database.

Step 5: Configure Web Server

Finally, we need to configure our web server to serve Lychee. Follow these steps:

  1. Edit the /etc/httpd/conf/httpd.conf file and add the following lines:
Alias /lychee /var/www/html/lychee
<Directory /var/www/html/lychee>
    AllowOverride All
</Directory>
  1. Restart your web server:
sudo systemctl restart httpd

Step 6: Access Lychee

Now that everything is set up, you can access Lychee by visiting http://localhost/lychee in your web browser.

Conclusion

By following the above steps, you have successfully installed Lychee on Manjaro. Lychee is a powerful photo management tool that makes it easy to organize, share, and backup your photos.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!