Integrating Immich.app with Nextcloud as a Media Server: A Superior Solution for Facial Recognition and Media Management Nextcloud has become a popular choice for individuals and organizations looking for a self-hosted cloud solution. Among its
Integrating Immich.app with Nextcloud as a Media Server: A Superior Solution for Facial Recognition and Media Management
Nextcloud has become a popular choice for individuals and organizations looking for a self-hosted cloud solution. Among its many features, Nextcloud offers several options for managing and viewing photos, including the Photos app and the Memories app. These apps also provide some basic facial recognition capabilities through integrations with tools like Recognize and Facedetection. However, these solutions have significant limitations, which often leave users frustrated with their performance and accuracy. This article explores how integrating Immich.app into Nextcloud as a media server can offer a far superior experience, thanks to its better face detection and classification capabilities, as well as advanced features like hardware acceleration.
Limitations of Current Nextcloud Photo Management Solutions
- Nextcloud Photos with Recognize: The Photos app, paired with Recognize, is intended to serve as a simple tool for photo viewing and basic face detection. Unfortunately, its performance as a photo viewer is underwhelming, with sluggish response times and limited functionality. Moreover, Recognize struggles with face detection accuracy, failing to identify many faces within photo libraries. This makes it an unreliable option for users looking to organize their photos by people.
- Nextcloud Memories with Facedetection: The Memories app is a better photo viewer compared to Photos, providing a more polished user experience directly within the Nextcloud interface. However, its face detection capabilities are limited by its reliance on either Recognize or Facedetection. While Facedetection boasts a robust face detection stack, its classification abilities are poor. This leads to a frustrating user experience where new photo uploads often result in previously clustered faces being misidentified, requiring manual reassignment and reorganization of clusters.
Why Immich.app is the Superior Alternative
Immich.app emerges as a powerful alternative to the existing photo management solutions in Nextcloud. It offers several key advantages:
- Advanced Facial Recognition and Classification: Immich.app outperforms both Recognize and Facedetection in terms of facial recognition and classification. The app not only accurately detects faces in photos but also reliably classifies them, ensuring that new photos are correctly categorized with minimal user intervention. This reduces the need for constant manual corrections, making photo management much more efficient and enjoyable.
- Superior Media Viewing Experience: As a media viewer, Immich.app offers a richer feature set than both Photos and Memories. It supports various media formats, provides a smooth browsing experience, and includes features like automatic photo enhancements, slideshows, and more. These functionalities make it a versatile and powerful tool for managing and viewing media collections.
- Hardware Acceleration for Enhanced Performance: Immich.app supports hardware acceleration, which can significantly improve performance, especially when handling large media libraries or high-resolution content. This is a critical feature that sets it apart from the default Nextcloud photo management options, which can struggle with performance issues as the size of the media library grows.
Integrating Immich.app with Nextcloud
To leverage the full potential of Immich.app, it can be integrated with Nextcloud, allowing it to access all media files stored within the Nextcloud environment. By configuring Immich.app as a media server, users can utilize its superior features and capabilities directly with their existing Nextcloud-stored media. This integration process involves setting up the Immich.app server and pointing it to the media directories managed by Nextcloud. Once set up, Immich.app can serve as the primary media viewer, offering seamless access to all photos and videos along with advanced face detection and classification.
Integrating Immich.app into a Nextcloud setup transforms the way media is managed and viewed. It offers a significant upgrade over the existing Photos and Memories apps by providing reliable and accurate face detection, better media viewing features, and enhanced performance through hardware acceleration. This makes it an ideal solution for anyone looking to streamline their photo management workflow and ensure their media is organized efficiently and accurately. With Immich.app, Nextcloud users can enjoy a more powerful, user-friendly, and reliable media management experience.
How to install the Immich.app on an already installed Nextcloud server as external files.
Advantages of Mounting Under /var/www/nextcloud/data/files-external:
Organized Structure:
The files-external
folder is an established location for external file storage in Nextcloud. This ensures a clear separation between internal Nextcloud data and external files or data sources.
Access Management:
Nextcloud already has mechanisms in place for managing and accessing external storage locations. Adding external file storage via this path can facilitate management and integration.
Security and Access Control:
By mounting in a specific subfolder like files-external
, you can ensure that permissions and access are better controlled, as this folder is specifically intended for external sources.
Avoidance of Conflicts:
Mounting the Immich folder in a separate subfolder within Nextcloud can help avoid conflicts or confusion between internal Nextcloud data and data managed by Immich.
Implementation:
To mount the Immich folder under /var/www/nextcloud/data/files-external
, you can adjust the docker-compose.yml
file accordingly.
Here are the steps:
- In the Nextcloud, download and install the App “External Storage”.
- Proceed to the Immich.app Download and install instructions here:
https://immich.app/docs/install/docker-compose - When you downloaded the docker-compose.yml file, edit it accordingly to the code box below, but with your own folder and user structure.
- Continue with the Immich.app installation
- Add an “external library” within the Immich app and add your “/var/www/nextcloud/data” folder
- Scan the external library within the Immich.app and enjoy a great media server with excellent features.
Example docker-compose.yml file:
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
user: "www-data"
volumes:
- /var/www/nextcloud/data/files-external:/usr/src/app/upload # Mount auf files-external
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:3001
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
user: "www-data"
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
restart: always
volumes:
model-cache:
In this file, the user www-data runs the Immich processes, same as the Nextcloud server. So you do not have to set rights or access and the Immich app simply can use the same source folder as the Nextcloud for the Images when it is added as external library within the Immich app. Also the storage folder (in my case a 4 TB harddrive is mouted in the Immich app as storage, but under the external files management of the Nextcloud installation, which you could also make availble within the Nextcloud, so you could see files that originate from Immich. I left this part out though, since I use the Nextcloud mobile app to upload all pictures from my Phone, and the Nextcloud desktop app to upload everything else, including my Sony and Fuji camera files.
If you want to only add the media files of one Nextcloud user, then edit the storage to the specific user path like “/var/www/nextcloud/data/user/files/Photos”. If you do this for selected users, you can control the access within the Immich app, where the owner of an external library can access only his own files and not the external library of another user. In this case, you have to add every needed Nextcloud user storage folder to the docker-compose.yml files and add different external libraries within the Immich app.
Now that works a bit better
Mounting the Immich folder under /var/www/nextcloud/data/files-external
provides a clear and structured way to integrate Immich data into Nextcloud without affecting Nextcloud’s internal structure. This approach simplifies management and ensures better organization of your data. Immich now can be used as media viewer with all its nice features, including GPS data, face recognition, face classification and clustering and much more.
There are probably many more integration parts that could be done here, let me know if you had other or better ideas.