Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thomasverelst/60403f22e7a9f5200b0dc43615c54720 to your computer and use it in GitHub Desktop.
Save thomasverelst/60403f22e7a9f5200b0dc43615c54720 to your computer and use it in GitHub Desktop.
# Edited based on comments of szaimen below.
# Working setup for photo storage in Nextcloud with Memories, Recognize, Preview Generator, Redis
# Use NextCloud-AIO https://github.com/nextcloud/all-in-one
# Following libraries are required and included by default since the latest beta image.
# exiftool is needed for Memories
# ffmpeg is needed for video thumbnails
# gcompat is needed for NodeJS in Recognize
# Note that currently Nextcloud 25.0.2 is still on the beta channel, so you'd have to use
# nextcloud/all-in-one:beta or nextcloud/all-in-one:beta-arm64 (for ARM) as image
# e.g. for ARM64:
sudo docker run \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 56344:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
-e NEXTCLOUD_ADDITIONAL_APKS="imagemagick" \
nextcloud/all-in-one:beta-arm64
# Tested on ARM64 with Memories v4.9.2 and Recognize 3.3.3, Preview Generator and Nextcloud 25.0.2
# This installs Nextcloud with Redis. Install Memories, Recognize and Preview Generator in Nextcloud GUI (Apps)
# Unfortunately, this setup cannot work with FaceRecognition app (https://github.com/matiasdelellis/facerecognition ) as pdlib PHP extension cannot be installed ( https://github.com/nextcloud/all-in-one#what-about-the-pdlib-php-extension-for-the-facerecognition-app)
# but the Recognize app has basic face recognition anyway.
# In case Recognize does not work, in Administration Settings > Recognize > Node.js section (bottom), set NodeJS location to
# /var/www/html/custom_apps/recognize/bin/node
# After installation of Memories, need to run index and video-setup OCC commands (see their installation instructions https://github.com/pulsejet/memories#-installation
and see nextcloud-aio instructions on how to run OCC commands https://github.com/nextcloud/all-in-one#how-to-run-occ-commands)
#! to load the timeline, preview-generator is required, otherwise your instance might (will) hang/crash/be slow trying to load all full-size images
# my personal config for preview settings:
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set --value="64 512" previewgenerator squareSizes
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set --value="64 512" previewgenerator widthSizes
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set --value="64 512" previewgenerator heightSizes
# Reduce JPEG quality for previews to save storage space
#! Already the default for Nextcloud AIO!
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set preview jpeg_quality --value="60"
# I did not get any Thumbnails for large images such as panoramas
#! Already the default for upcoming release of Nextcloud AIO!
# this was because of the maximum memory size for preview generation, to solve this, add this option in your config.php (command: sudo nano /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/config/config.php )
'preview_max_memory' => 256,
# set up a crontab to automatically generate previews:
sudo crontab -u root -e
# and add
# generate previews for new files every 10 minutes
*/10 * * * * sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ preview:pre-generate
# generate previews for all files every 24h at 2am
# this one rechecks all files and should not be needed, but maybe good idea to run ocassionaly if some files were skipped somehow
0 2 * * * sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ preview:generate-all
# Further:
# set up backups and automatic updates from the nextcloud AIO admin panel.
# install fail2ban https://github.com/nextcloud/all-in-one#fail2ban
# Nextcloud AIO includes some standard apps that you might want to remove if you dont use them (e.g. Decks, Contacts,..)
@szaimen
Copy link

szaimen commented Jan 24, 2023

Hi, I think all things should be released by now 👍

@szaimen
Copy link

szaimen commented Feb 19, 2023

Hi, it looks like this should fix the requirement on gcompat for arm64 in a future update: nextcloud/recognize@30602dc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment