Scripted installation of Lychee Photo Manager

Lychee Photo Manager is “A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.” See the link above for screen shots. Here’s a script to create a TrueNAS Core 12.0 jail with Lychee and its dependencies installed:

Change to a convenient directory on your FreeNAS box and clone the repo with https://github.com/danb35/freenas-iocage-lychee. Then change into the freenas-iocage-lychee directory and create lychee-config with your favorite text editor. Minimally, it needs to include:

JAIL_IP="192.168.1.79"
DEFAULT_GW_IP="192.168.1.1"
POOL_PATH="/mnt/tank"

The first two parameters should be self-explanatory; the third is the path to the root of your data pool. If you have more than one data pool, choose the one where you want the Lychee data files to live.

Once you’ve created the config file, run the script with script lychee.log ./lychee-jail.sh. Note that it may take some time to run. You may want to consider running it in a tmux session, to avoid issues if you inadvertently disconnect while the script is running. When it finishes, it will tell you so:

Installation complete!
Using your web browser, go to http://192.168.1.79 to log in
Database passwords are saved in /root/lychee_db_password.txt

Do what it says, and browse to the IP address with your web browser. You should see this:

Click Next, and you should see this:

Scroll down and click Next to get this page:

Scroll down to click Next again, which will result in this page:

No edits need to be made here–the script has already created the database, created a database user with a secure password, and added this information to this configuration file. Scroll to the bottom of the page and click Install.

The next page will have lots of status information; all should have completed successfully. Click on the this page link.

This is where you’ll create your admin user–enter the desired username and password, and click Create Login. And you’re done with the installation. For more information on configuring and using Lychee, check out the Lychee docs.

I must not have something configured properly. The script creates the new jail, but is unable to install any of the specified packages.

pkg error:

  • pkg-static: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory

The most common problem would be with networking in the jail. What do you get if you run ping google.com inside the jail?

Thanks Dan. It turned out to be a couple of things, both my errors. 1. Fat fingered the gateway IP. 2. Needed to enable the FreeBSD repo. Not sure if I also needed to disable the usr ports repo, but did that as well.

All is working now, and my wife is overjoyed that she can upload pictures of our nieces.

Thanks for the repo and guide.

1 Like

In the sample lychee-config you give an IP ending in 78.

Should this not end in 78 as well for consistency of documentation?

Unfortunately, I clicked away from the terminal while part way through the script not realizing that would kill the runnung script. Can I just re-run the script to complete it or should I kill the lychee jail and start over?

Thanks for the great scripts.

Sorted this out. Had to delete jail and re-run the script.

This installation could do with a warning though, ie Be patient, install will take some time!

Both good points, I’ve edited the OP to address them.

2 Likes

Hi @danb35,

Have you had any reports of errors using Lychee on TrueNAS Core U2?

I am finding my 16 Gb of memory is being consumed at about 0.6 Gb of “services” memory cache on TrueNAS each time I upload photos. Along with the services not releasing cache when finished I get at lot of errors, one photo getting two consecutive names and the second photo being missed, scrambled photos (bits and pieces of two or more photos), blank and tiny thumbnails and Lychee not being able to find the occasional photo.

I am not sure that this is the right place for this or whether the problem is with my system, TrueNAS, Lychee or my NICs.

Thank you for any assistance you can give.