How to Install LibrePhotos on Elementary OS Latest

LibrePhotos is a free and open-source self-hosted photo management service. In this tutorial, we will go through the steps to install LibrePhotos on Elementary OS latest through the command line.

Prerequisites

Step 1: Update and Upgrade the System

Before we start the installation process, it's important to update and upgrade the system to ensure we have the latest packages and dependencies.

To do this, log in to your server and run the following command:

sudo apt update && sudo apt upgrade -y

This command updates the package list and upgrades all packages to their latest version.

Step 2: Install Required Dependencies

LibrePhotos requires some dependencies to be installed before it can be installed. Install the required dependencies by running the following command:

sudo apt install -y python3-pip libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev

This will install the necessary dependencies for LibrePhotos to function.

Step 3: Install MySQL Server

LibrePhotos requires a database to store its data. In this step, we will install MySQL which is a popular open-source relational database management system.

To install MySQL server, run the following command:

sudo apt install -y mysql-server

Once the installation is complete, run the following command to set up the root password:

sudo mysql_secure_installation

Follow the prompt and provide a strong password for the root user, and answer the remaining questions as appropriate.

Step 4: Install LibrePhotos

Once the dependencies are installed, we can proceed to install LibrePhotos. To do this, run the following command:

sudo pip3 install librephotos

This command will install the latest version of LibrePhotos and all its dependencies.

Step 5: Configure the Application

Now that we have installed LibrePhotos, it's time to configure the application.

Firstly, create a new database for LibrePhotos:

sudo mysql -u root -p

CREATE DATABASE librephotos_db;
GRANT ALL PRIVILEGES ON librephotos_db.* TO 'librephotos_user'@'localhost' IDENTIFIED BY 'strongpassword';
FLUSH PRIVILEGES;
EXIT;

Note: Replace "strongpassword" with a strong password for the 'librephotos_user'.

Next, we need to specify the database connection details by creating a new config file:

sudo nano /etc/librephotos/config.py

Add the following contents to the file, replacing the database details with your own:

# LibrePhotos Config
DATABASE_URI = "mysql+pymysql://librephotos_user:strongpassword@localhost/librephotos_db"

Note: Replace "strongpassword" and "librephotos_user" with your chosen password and username respectively.

Finally, we need to initialize the database by running the following command:

librephotos initdb

Step 6: Run LibrePhotos

We have now installed and configured LibrePhotos on our Elementary OS Latest system. It's time to run it.

To run LibrePhotos, enter the following command:

librephotos runserver

This will start the application and make it accessible at http://localhost:5000.

Congratulations! You have successfully installed and configured LibrePhotos on your Elementary OS Latest system.

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!