User Tools

This is an old revision of the document!


HomeGallery

HomeGallery is a nice photo gallery to be self-hosted. It support AI and many other features.

It comes with Docker and bare-metal instructions, which i like very much. Also it supports base-url's too.

The reverse-geocoding and AI stuff is accessed via public APIs on api.home-gallery.org specially for low-powered devices, but if your server can support it, you can also self host this part using Docker/Podman.

Installation

Full documentation is well maintained and csan be found here.

Create a homegallery user as a memeber of the photos group:

useradd -d /deposito/daemons/homegallery -m -g photos homegallery
su - homegallery
curl -sL https://dl.home-gallery.org/dist/latest/home-gallery-latest-linux-x64 -o gallery
chmod 755 gallery

Installing the API server is ismpler using a container, do use the following docker-compose.yml:

docker-compose.yml
version: "3.9"
services:
  api:
    # custom build via
    #build: packages/api-server
    image: xemle/home-gallery-api-server
    environment:
      # TensorflowJS backends
      # - cpu: slowest and best support
      # - wasm: good perfromance for arm64 and amd64 platforms
      # - node: best performance on amd64 platform
      #- BACKEND=cpu
      #- BACKEND=wasm
      - BACKEND=node
    ports:
      - "3023:3000"

Then the usual:

podman compose pull

Configuration

Full configuration is here.

First of all, run HomeGallery to let it initialize the configiuration:

./gallery run init --source ~/Pictures

Now you can edit the /data/daemons/homegallery/.config/home-gallery/gallery.config.yml. In detail, you will want to edit at least the following values:

gallery.config.yml
extractor:
  apiServer:
    url: http://localhost:3023
    timeout: 30
    concurrent: 5

server:
  port: 3022
  host: '127.0.0.1'
  BasePath: /gallery/

Please note that for BasePath to work, the trailing / is required!

Reverse Proxy

Example NGINX configuration:

gallery.conf
location /gallery/ {
        proxy_pass http://127.0.0.1:3022/;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
}

Refer to The Reverse Proxy concept for more details.

Startup

Create the following script /data/daemons/homegallery/homegallery.sh:

homegallery.sh
#/bin/bash
./gallery run server
</code>

Start on boot, first start the container for the API server, add to your **/etc/local.d/80-containers.start** and **/etc/local.d/80-containers.stop**:
<file - 80-containers.start>
su - homegallery -c "podman compose up -d"

and

80-containers.stop
su - homegallery -c "podman compose down"

Then start the server with the script /etc/local.d/81-homegallery.start:

81-homegallery.start
#!/bin/bash
/deposito/daemons/homegalery/homegallery.sh

Ensure the server starts after the container.

Make the scripts executable!

Upgrade

See here:

kill gallery
podman compose down
podman compose pull
mv gallery gallery.old
curl -sL https://dl.home-gallery.org/dist/latest/home-gallery-latest-linux-x64 -o gallery
chmod 755 gallery
podman compose up -d
./gallery run import
./gallery run server &

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information