Immich on OpenBSD

Immich has been on my radar for a while. I used to use google photos, but for a while now I’ve simply had my photos locally on my phone and synced with Syncthing to my NAS as a backup. I miss some of the advanced features like being able to search through photos and having them automatically categorised, as well as more basic features like simply being able to store them on the server-only to save space on my phone, but still download them on demand to view them.

There’s a major problem with this idea: Immich’s only officially supported installation method is via docker-compose and I’m currently running OpenBSD on my new server, which can not run docker containers.

I had a couple of options:

I have chosen the first path. TL; DR: It hasn’t worked yet.

To begin with, I downloaded the source code and looked at the docker-compose.yml file which is the officially supported installation mechanism. This tells me that immich comprises four applications: Postgres database, Redis database, a server application, and a machine learning application.

The redis database was very easy to set up. Redis is available in OpenBSD packages and can be installed with pkg_add redis, then enabled and started with rcctl enable redis and rcctl start redis.

The postgres database was also initially quite simple. Postgres is available in OpenBSD packages as well, so pkg_add postgresql-server and following the instructions will get you a running postgres server. Since I had already done this for some other applications on my server; I decided to create a new user and database in the existing server for immich to use. There’s documentation from immich on how to set up your existing postgres database for immich to use.

However, the documentation indicates that two extensions are required for immich to function: pgvector and VectorChord. Neither extension is pre-installed in the OpenBSD default build of postgres.

Pgvector was easy enough to compile and install: download the source code, ensure GNU make is installed since the makefile is a GNU make one pkg_add gmake, and run the commands from the README.md (subsituting make for gmake and sudo for doas or run that step as root).

VectorChord is a bit more difficult; and this is where I am currently stuck. The install instructions for VectorChord are very similar to pgvector, however VectorChord is written in rust. While the rust compiler is available in OpenBSD packages, it is an older version: 1.81.0 at the time of writing, wheras the current version is 1.87.0. Unfortunately VectorChord and some of it’s dependencies require newer versions of rustc to compile. I tried to go ahead and compile with 1.81.0 anyway; but some dependencies fail to build.

I did go ahead and try to set up the other components without completing VectorChord support; however it seems this is a hard dependency and cannot be skipped.

My next step is to attempt to get a later version of Rust on my server in order to compile VectorChord. I’ll update this page with further progress…