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 app's backend. 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 for all LibrePhotos-related files.
Open the downloaded archive and extract the
librephotos-docker-main
folder to an easily accessible location.
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. Docker Compose uses the variables in this file to build the LibrePhotos instance.
Create a new environment file
Open PowerShell.
Navigate to the
librephotos-docker
folder using thecd
command. ExampleRun the following command to duplicate the sample environment file and name it
.env
:
Specify your picture location
Open the newly created file using Notepad by running this command:
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:Set the value of
data
to the path of thelibrephotos-docker
folder by entering the folder’s path, followed by/data
within single quotation marks (') after the equals sign, as shown:Press Ctrl + S to save changes.
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.
Deploying LibrePhotos
While in the librephotos-docker
directory, execute the following command in the command line to start creating your LibrePhotos instance:
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:
Open your internet browser and visit the following URL:
localhost:3000/
Fill in the provided fields with your personal information, such as your username, email, and password, and click Sign up.
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:
Click the Edit user button.
In the new window, under Choose a directory from below, click data.
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:
Click the user icon in the upper-right corner and select Library.
Under Photos, click the Scan 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:
Under Photos, click the Toggle select mode button.
Select the pictures you want to include in your album by clicking them.
Click the plus (+) button on the right and select Album.
In the Album title field, 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.
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:
Click the user icon in the upper-right corner and select Admin area.
Under Users, select Add new user.
Fill in the required fields for the new user and click Save.
In the Users table, select the Modify button next to the newly created account.
Under Choose a directory from below, click the dropdown arrow next to data.
Select the folder that you want the user to see pictures from.
Click Save.
The new account is now active. LibrePhotos will automatically start a scan of the selected picture library for the new user.
Access your picture library over Meshnet
Note
If you're hosting LibrePhotos on a Linux device, you must grant the local network permission for the devices accessing it. For more information, see Common issues on Linux.
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:
Copy the Nord name of the device hosting LibrePhotos from the NordVPN app.
Open your internet browser.
In the URL field, paste the copied Nord name followed by
:3000
and press Enter. ExampleEnter 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.
Last updated