Search
K
Links

How to set up a remote picture library with LibrePhotos and Meshnet

Discover how to configure a personal picture library using Librephotos and access it remotely over Meshnet.

Introduction

Having your own easily accessible picture library can prove to be beneficial when you want to share pictures with your friends or family. Instead of sending files one by one and waiting for the transfers to finish, you can provide them with a link to see the latest images of your pets or a recent trip to the mountains.
While there are cloud-based solutions that offer similar functionality, self-hosting your image library puts you in full control, and you don’t need to worry about pricing or cloud storage restrictions. Additionally, the files never have to leave your device.
By using self-hosted picture management tools, such as the open-source LibrePhotos project, alongside Meshnet, you can set up a secure, remotely accessible picture library. Meshnet creates encrypted network tunnels between your image server and the connecting devices without SSL certificates or port forwarding.
This article describes how you can self-host a LibrePhotos picture library and access it remotely using Meshnet.

Before you begin

To follow this guide, you must have Docker and Docker Compose installed on your device. Instructions on how to download and install these tools can be found on the Docker website:
Note
Docker Compose comes pre-installed with Docker Desktop.

Deploy LibrePhotos using Docker

The LibrePhotos instance consists of several containers, such as a database container and a container for the backend of the app. To make the deployment of multi-container applications more efficient, the Docker Compose tool is used.

Preparing a working directory

For convenient deployment and management, prepare a specific directory where all LibrePhotos-related files will be located.
Windows
macOS and Linux
  1. 1.
    Download the LibrePhoto Docker files from its GitHub repository by clicking Code > Download ZIP.
    Clicking 'Download ZIP' in the LibrePhotos GitHub repository.
  2. 2.
    Open the downloaded archive and extract the librephotos-docker folder to an easily accessible location.
This will be the working directory of your LibrePhotos Docker container.
  1. 1.
    Open Terminal.
  2. 2.
    Download the LibrePhotos Docker files from its GitHub repository by running the following git clone command:
    git clone https://github.com/LibrePhotos/librephotos-docker.git
  3. 3.
    Run the ls command to check if the librephotos-docker folder is present.
This will be the working directory of your LibrePhotos Docker container.

Modifying the environment variables

Before deploying the container, you need to edit the parameters in the environment file. The variables in this file are used by Docker Compose to build the LibrePhotos instance.
Windows
macOS and Linux

Create a new environment file

  1. 1.
    Open PowerShell.
  2. 2.
    Navigate to the librephotos-docker folder using the cd command. Example
    cd ~/Desktop/docker/librephotos-docker
  3. 3.
    Run the following command to duplicate the sample environment file and name it .env:
    copy librephotos.env .env

Specify your picture location

  1. 1.
    Open the newly created file using Notepad by running this command:
    notepad .env
  2. 2.
    Set the value of scanDirectory to the path of your picture library by entering the path within single quotation marks (') after the equals sign, as shown:
    Entering the path of the picture library.
  3. 3.
    Set the value of data to the path of the librephotos-docker folder by entering the folder’s path, followed by /data within single quotation marks (') after the equals sign, as shown:
    Entering the path of the LibrePhotos data folder.
  4. 4.
    Press Ctrl + S to save changes.
  5. 5.
    Exit Notepad.
Tip
If you want to change the port used by LibrePhotos, you can alter the number after the equal sign of the httpPort line.
Line indicating the port of the LibrePhotos web interface.

Create a new environment file

  1. 1.
    Open Terminal.
  2. 2.
    Navigate to the librephotos-docker folder using the cd command.
    Example
    cd ~/Docker/librephotos-docker
  3. 3.
    Run the following command to duplicate the sample environment file and name it .env:
    cp librephotos.env .env

Specify your picture location

  1. 1.
    Open the newly created file using the Nano text editor by running this command:
    nano .env
  2. 2.
    Set the value of scanDirectory to the path of your picture library by entering the path within single quotation marks (') after the equals sign, as shown:
    Example
    Entering the path of the picture library.
  3. 3.
    Set the value of data to the path of the librephotos-docker folder by entering the folder’s path, followed by /data within single quotation marks (') after the equals sign, as shown:
    Example
    Entering the path of the LibrePhotos data folder.
  4. 4.
    Press Ctrl + X, Y, and Enter to save changes and exit.
Tip
If you want to change the port used by LibrePhotos, you can alter the number after the equal sign of the httpPort line.
Line indicating the port of the LibrePhotos web interface.

Deploying LibrePhotos

While in the librephotos-docker directory, execute the following command in the command line to start creating your LibrePhotos instance:
docker-compose up -d
Docker will pull the resources and dependencies required for LibrePhotos and create the required containers. You can expect the initial deployment to take several minutes.

Set up your LibrePhotos web interface

With the containers up and running, you can access the web interface of LibrePhotos to configure your picture library. By default, the web interface listens on port 3000.

Creating an administrator account

To control LibrePhotos, you must first create an administrator account. To create the account:
  1. 1.
    Open your internet browser and visit the following URL: localhost:3000/
  2. 2.
    Fill in the provided fields with your personal information, such as your username, email, and password, and click Sign up.
    Filling in the account details on the LibrePhotos sign up page.
  3. 3.
    On the login page, enter your username and password and click Log in.
Note
If you see the login page instead of the account creation screen, reload the page.

Scanning the picture library

At first, you will not see any images in your LibrePhotos web interface. This is because the tool has not yet scanned and indexed your pictures.

Perform the initial scan

To scan the picture library for the first time:
  1. 1.
    Click the Edit user button.
  2. 2.
    In the new window, under Choose a directory from below, click data.
    Selecting the picture directory.
  3. 3.
    Click Save.
LibrePhotos will start scanning all files in the directory that was specified in the .env file. Once the scan is over, you will see a Finished message in the lower-right corner of the screen.
To see all of the pictures, reload the page.

Add more pictures

LibrePhotos does not automatically scan the added folders. This means newly added pictures will not appear until you re-scan the folders. To start a scan:
  1. 1.
    Click the user icon in the upper-right corner and select Library.
  2. 2.
    Under Photos, click the Scan photos (filesystem) button.
Once the scan finishes, you will see a Finished message in the lower-right corner of the page.

Creating albums

By default, all images are sorted by their creation date. However, you may want to categorize your pictures into albums for a more convenient user experience. To create albums:
  1. 1.
    Under Photos, click the Toggle select mode button.
    Clicking the 'Toggle select mode' button.
  2. 2.
    Select the pictures you want to include in your album by clicking them.
  3. 3.
    Click the plus (+) button on the right and select Album.
    Selecting 'Album' form the list of options.
  4. 4.
    Under New album, enter the name of your album and click Create.
To view the new album and its contents, select Albums > My albums from the left-side menu.
My albums sections of LibrePhotos.

Creating new users

Giving administrator access to other people may pose risks. It is good practice to have dedicated user accounts for people who only want to view the pictures, but should not have control over the library’s settings. To create additional users:
  1. 1.
    Click the user icon in the upper-right corner and select Admin area.
  2. 2.
    Under Users, select Add new user.
  3. 3.
    Fill in the required fields for the new user.
    Filling in details for a new user account.
  4. 4.
    Under Choose a directory from below, click the dropdown arrow next to data.
  5. 5.
    Select the folder that you want the user to see pictures from.
    Selecting a folder.
  6. 6.
    Click Save.
You can see the newly created account under Users after reloading the page.
New user visible in the Users table.

Access your picture library over Meshnet

With the pictures indexed and visible, you can share your photo library with others or access it remotely yourself. To access your LibrePhotos instance using Meshnet:
  1. 1.
    Copy the Nord name of the device hosting LibrePhotos from the NordVPN application.
  2. 2.
    Open your internet browser.
  3. 3.
    In the URL field, paste the copied Nord name followed by :3000 and press Enter. Example
    Accessing LibrePhotos using the Nord name.
  4. 4.
    Enter your username and password and click Login.
You can now freely browse the picture library from a remote location without compromising your device’s security.
Browsing LibrePhotos over Meshnet.
© 2023 Nord Security. All Rights Reserved.