How to Install Lychee on Debian Latest
Lychee is a free and open-source photo management application. It allows users to upload, organize, and share their photos on their own servers. In this tutorial, you will learn how to install Lychee on Debian Latest in a few simple steps.
Prerequisites
Before installing Lychee, make sure you have the following:
- A Debian Latest server with a minimum of 1GB RAM
- A non-root user with sudo privileges
- Apache or Nginx web server installed and configured
- MySQL or MariaDB database management system installed and configured
Step 1: Update Your System
Before installing any new software, it is always recommended to update your system to the latest version. You can update your Debian system by running the following command:
sudo apt-get update && sudo apt-get -y upgrade
Step 2: Install Required Packages
To run Lychee, you need to install some packages on your Debian system, including PHP, MySQL, and other dependencies.
sudo apt-get install -y apache2 mariadb-server php-mysql php-gd php-curl php-xml php-zip unzip
Step 3: Download and Install Lychee
- Download the latest version of Lychee from the official website using the following command:
wget https://github.com/LycheeOrg/Lychee/archive/master.zip
- Move the downloaded file to the Apache or Nginx web server root directory.
sudo mv master.zip /var/www/html/
- Navigate to the web server root directory and extract the downloaded file using the following command:
sudo cd /var/www/html/
sudo unzip master.zip
- Rename the extracted folder to "lychee" and set the appropriate permissions.
sudo mv Lychee-master lychee
sudo chown -R www-data:www-data lychee/
Step 4: Configure the Database
- Login to the MySQL or MariaDB database management system using the root user.
sudo mysql -u root -p
- Create a new database and a new user.
CREATE DATABASE lychee;
CREATE USER 'lycheeuser'@'localhost' IDENTIFIED BY 'lycheepassword';
GRANT ALL PRIVILEGES ON lychee.* TO 'lycheeuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 5: Configure PHP Settings
- Open the PHP configuration file using your favorite text editor.
sudo nano /etc/php/7.X/apache2/php.ini
- Search and modify the following values:
upload_max_filesize = 20M
post_max_size = 20M
memory_limit = 512M
- Save the file and exit the text editor.
Step 6: Configure the Apache or Nginx Web Server
- Create a new virtual host configuration file for Lychee using the following command:
sudo nano /etc/apache2/sites-available/lychee.conf
- Add the following lines to the file, and save it:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/lychee
<Directory /var/www/html/lychee/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/lychee_error.log
CustomLog ${APACHE_LOG_DIR}/lychee_access.log combined
</VirtualHost>
- Enable the Lychee virtual host configuration file and reload the Apache web server.
sudo a2ensite lychee.conf
sudo systemctl reload apache2
Step 7: Accessing Lychee
Lychee is now installed and configured on your Debian system. You can access it by navigating to your server's IP address or domain name (e.g., http://yourdomain.com) in a web browser.
Congratulations! You have successfully installed Lychee on Debian Latest. Enjoy your photo management experience!