How to Install Lychee on Linux Mint Latest

Lychee is a free and open-source photo management tool that enables you to upload, store and organize your images, and share them with others. In this tutorial, we will show you how to install Lychee on Linux Mint Latest.

Prerequisites

Before installing Lychee, ensure that your system meets the following requirements:

Step 1: Update the System

Start by updating your system packages to the latest version by running the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Apache

Next, install the Apache web server by running the following command:

sudo apt install apache2 -y

After installation, start the Apache server and enable it to start on boot:

sudo systemctl start apache2
sudo systemctl enable apache2

Step 3: Install MySQL

If you already have MySQL or MariaDB installed on your system, you can skip this step. Otherwise, install MySQL by running the following command:

sudo apt install mysql-server -y

After installation, start the server and enable it to start on system boot:

sudo systemctl start mysql
sudo systemctl enable mysql

By default, MySQL installation will not secure any password, and it is highly recommended to secure the MySQL installation before continuing.

sudo mysql_secure_installation

Step 4: Install PHP

Lychee requires PHP version 7.1.3 or higher with some extensions. Here, we install PHP 7.4 with required extensions. To install, run the following command:

sudo apt install php7.4 php7.4-mysql php7.4-mbstring php7.4-exif php7.4-gd php7.4-curl -y

Once installed, restart the Apache server:

sudo systemctl restart apache2

Step 5: Download and Install Lychee

Go to the Lychee website and download the latest version of Lychee. After downloading, extract the contents to the Document root of your webserver, which is at /var/www/html. Here, we use the wget command to download and extract the tar file:

cd /var/www/html
sudo wget https://github.com/LycheeOrg/Lychee/releases/download/v4.0.6/Lychee-v4.0.6.tar.gz
sudo tar -xvzf Lychee-v4.0.6.tar.gz
sudo mv Lychee-v4.0.6 lychee

After extracting the contents, set the correct permissions and ownership:

sudo chown -R www-data:www-data /var/www/html/lychee
sudo chmod -R 755 /var/www/html/lychee

Step 6: Create and Configure Database

Now, create a new database user and database for Lychee:

sudo mysql -u root -p

Provide your MySQL root password and execute the following SQL commands:

CREATE DATABASE lychee_db;
CREATE USER 'lychee_user'@'localhost' IDENTIFIED BY 'lychee_password';
GRANT ALL PRIVILEGES ON lychee_db.* TO 'lychee_user'@'localhost';
FLUSH PRIVILEGES;
exit

Next, copy the config file:

cp /var/www/html/lychee/data/config.php /var/www/html/lychee/data/config-OLD.php
cp /var/www/html/lychee/data/config.php.example /var/www/html/lychee/data/config.php

Then edit the config file:

sudo nano /var/www/html/lychee/data/config.php

Replace the following values with your custom ones:

$dbHost = 'localhost';
$dbUser = 'lychee_user';
$dbPassword = 'lychee_password';
$dbName = 'lychee_db';

Save and exit the file.

Step 7: Accessing Lychee

You can now open the Lychee application in your browser. To do this, enter the IP address of your server in your browser, followed by '/lychee' (Example: http://192.168.1.2/lychee/).

You should see the Lychee login screen, where you can create your admin account and start using Lychee.

Conclusion

That's it! You have successfully installed Lychee on Linux Mint Latest. You can now upload, store, and organize your images with ease.

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!