What is Lychee?
Lychee is a free photo-management tool, which runs on your server or web-space. Installing is a matter of seconds. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. -https://lycheeorg.github.io/
Installation
- Log into the Linux device
- Run the following commands in a terminal window:
# update software repositories
sudo apt update
# install available software updates
sudo apt upgrade -y
# install prerequisites
sudo apt install curl wget zip -y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb-server mariadb-client -y
# install PHP components
sudo apt install php php-common php-mysqli php-mysql php-pdo-mysql php-bcmath php-gd php-xsl php-mbstring php-dom php-imagick php-xml -y
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type N and press Enter to not switch to unix socket authentication
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the Lychee database and database user
CREATE DATABASE lychee;
GRANT ALL ON lychee.* to 'lychee_rw'@'localhost' IDENTIFIED BY 'Lych33!';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands:
# fetch the latest download URL
regex='"browser_download_url": "(https:\/\/github.com\/LycheeOrg\/Lychee\/releases\/download\/[^/]*\/[^/]*\.zip)"' && response=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/LycheeOrg/Lychee/releases/latest) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"
# download the latest release
wget -O /tmp/lychee.zip $downloadURL
# extract the downloaded zip to /var/www
sudo unzip /tmp/lychee.zip -d /var/www
# rename the extracted folder
sudo mv /var/www/Lychee* /var/www/lychee
# set the owner of the lychee directory
sudo chown -R www-data:www-data /var/www/lychee
# create lychee apache configuration
sudo nano /etc/apache2/sites-available/lychee.conf - Paste the following configuration into lychee.conf
Alias /lychee "/var/www/lychee/public"
<Directory /var/www/lychee/public>
# enable the .htaccess rewrites
AllowOverride All
Order allow,deny
Allow from All
</Directory> - Press CTRL+O, Enter, CTRL+X to write the changes
- Run the following command to enable the lychee site
# enable rewrite module
sudo a2enmod rewrite
# enable the lychee site
sudo a2ensite lychee
# restart the apache2 service
sudo systemctl restart apache2
Lychee Web Installer
- Open a web browser and navigate to http://DNSorIP/lychee
- Click Next at the Lychee welcome screen
- Click Next at the Requirements Check
- Click Next at the Permissions Check
- Update at least the following values in the
APP_URL=http://DNSorIP
APP_DIR=/lychee
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=lychee
DB_USERNAME=lychee_rw
DB_PASSWORD=Lych33! - Click Save > Click Install
- Once the installation completes click Set up admin account
- Enter a Username > Enter and confirm a Password > Click Create admin account
- Click Open Lychee
- Welcome to Lychee
Documentation: https://lycheeorg.github.io/docs/#installation