Skip to content

Deploying Nextcloud Memories

Introduction

Nextcloud Memories is a powerful photo and video management application for Nextcloud that transforms your self-hosted cloud storage into a feature-rich photo gallery. Designed as a modern alternative to Google Photos, Memories provides intelligent organization through AI-powered face recognition, automatic location mapping, and intuitive timeline-based browsing.

Built as a Nextcloud app, Memories integrates seamlessly with your existing Nextcloud installation, leveraging your stored photos and videos without requiring data migration. The application uses machine learning for face clustering, EXIF data extraction for timeline organization, and reverse geocoding for location-based albums.

Key highlights of Nextcloud Memories:

  • Timeline View: Browse your photo collection chronologically with an intuitive, responsive interface
  • AI Face Recognition: Automatically detect and cluster faces for easy people-based organization
  • Location Mapping: View photos on a world map based on GPS metadata
  • Albums and Tags: Create custom albums and tag photos for flexible organization
  • Video Playback: Full support for video files with transcoding capabilities
  • Sharing: Share individual photos, albums, or entire folders with others
  • Mobile-Friendly: Responsive design works seamlessly on phones and tablets
  • EXIF Viewer: View detailed metadata including camera settings, date, and location
  • Bulk Operations: Select and manage multiple photos simultaneously
  • Open Source: Licensed under AGPL-3.0 with active community development

This guide walks through deploying Nextcloud with the Memories app on Klutch.sh using Docker.

Why Deploy Nextcloud Memories on Klutch.sh

Deploying Nextcloud Memories on Klutch.sh provides several advantages for managing your photo library:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Nextcloud without complex orchestration. Push to GitHub, and your photo management platform deploys automatically.

Persistent Storage: Attach persistent volumes for your photo library, database, and configuration. Your memories survive container restarts and redeployments without data loss.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your photos from anywhere without manual certificate management.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates to your Dockerfile trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on your library size. The AI features benefit from additional resources for face recognition processing.

Environment Variable Management: Securely store database credentials and configuration through Klutch.sh’s environment variable system.

Custom Domains: Assign a custom domain for a professional, personalized photo gallery experience.

Always-On Availability: Your photo library remains accessible 24/7 without managing your own hardware.

Prerequisites

Before deploying Nextcloud Memories on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • Your photo collection ready to upload
  • (Optional) A custom domain for your Nextcloud instance

Understanding Nextcloud Memories Architecture

Nextcloud Memories operates as an app within the Nextcloud ecosystem:

Nextcloud Core: The base platform providing file storage, user management, and the app framework. Nextcloud handles authentication, file synchronization, and sharing capabilities.

Memories App: A Nextcloud app that provides the photo gallery interface, face recognition, and organization features. It reads directly from your Nextcloud files.

Database Backend: Nextcloud requires a database (MySQL/MariaDB or PostgreSQL) for storing metadata, user information, and Memories-specific data like face clusters.

Transcoding Service: Optional ffmpeg-based transcoding for video playback optimization and generating video thumbnails.

Machine Learning: Face recognition uses local machine learning models for privacy-preserving face detection and clustering.

Deploying Nextcloud Memories on Klutch.sh

    Create Your GitHub Repository

    Create a new GitHub repository for your Nextcloud Memories deployment configuration. This repository will contain your Dockerfile and any custom settings.

    Create the Dockerfile

    Create a Dockerfile in your repository root:

    FROM nextcloud:stable
    # Install dependencies for Memories
    RUN apt-get update && apt-get install -y \
    ffmpeg \
    libmagickcore-6.q16-6-extra \
    perl \
    && rm -rf /var/lib/apt/lists/*
    # Install exiftool for EXIF data extraction
    RUN apt-get update && apt-get install -y \
    libimage-exiftool-perl \
    && rm -rf /var/lib/apt/lists/*
    # Set recommended PHP settings
    RUN { \
    echo 'memory_limit=1024M'; \
    echo 'upload_max_filesize=10G'; \
    echo 'post_max_size=10G'; \
    echo 'max_execution_time=3600'; \
    echo 'max_input_time=3600'; \
    } > /usr/local/etc/php/conf.d/memories.ini
    EXPOSE 80

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “nextcloud-memories”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select the repository containing your Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    MYSQL_HOSTYour database host
    MYSQL_DATABASEnextcloud
    MYSQL_USERYour database username
    MYSQL_PASSWORDYour database password
    NEXTCLOUD_ADMIN_USERAdmin username
    NEXTCLOUD_ADMIN_PASSWORDSecure admin password
    NEXTCLOUD_TRUSTED_DOMAINSYour app domain

    Attach Persistent Volumes

    Add persistent storage for your data:

    Mount PathRecommended SizePurpose
    /var/www/html10 GBNextcloud installation and configuration
    /var/www/html/data500+ GBPhoto and video storage

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will build the container, attach volumes, and start your Nextcloud instance.

    Install the Memories App

    After deployment, access your Nextcloud instance and:

    1. Log in as the admin user
    2. Navigate to Apps
    3. Search for “Memories”
    4. Click Install
    5. Enable the app

    Configure Memories

    Access Settings and configure Memories:

    1. Run the initial indexing to scan your photos
    2. Enable face recognition if desired
    3. Configure video transcoding settings

Initial Configuration

Indexing Your Photos

After installing Memories, index your existing photos:

  1. Navigate to Settings in Nextcloud
  2. Select Memories from the left sidebar
  3. Click “Index” to start scanning your photo library
  4. Monitor progress in the indexing status section

Enabling Face Recognition

To enable AI-powered face recognition:

  1. Go to Memories settings
  2. Enable “Face Recognition”
  3. Allow the background job to process your photos
  4. Named faces will appear in the People section

Video Transcoding

For optimal video playback:

  1. Ensure ffmpeg is installed (included in our Dockerfile)
  2. Enable transcoding in Memories settings
  3. Configure quality presets based on your storage and bandwidth

Production Best Practices

Performance Optimization

  • PHP Memory: The Dockerfile sets 1024M memory limit for processing large images
  • Background Jobs: Configure Nextcloud cron for regular maintenance tasks
  • Database Tuning: Use InnoDB with appropriate buffer pool size for MariaDB/MySQL
  • OPcache: Enable PHP OPcache for improved performance

Security Recommendations

  • Use strong, unique passwords for all accounts
  • Enable two-factor authentication for admin accounts
  • Keep Nextcloud and the Memories app updated
  • Configure proper file permissions on volumes
  • Use Klutch.sh environment variables for sensitive data

Backup Strategy

Protect your photo library with regular backups:

  1. Database Backups: Export your database regularly
  2. File Backups: Back up the /var/www/html/data volume
  3. Configuration: Back up /var/www/html/config

Troubleshooting Common Issues

Photos Not Appearing

  • Verify files are in supported formats (JPEG, PNG, HEIC, etc.)
  • Check that indexing has completed
  • Ensure proper file permissions on the data directory
  • Review Nextcloud logs for errors

Face Recognition Not Working

  • Confirm the feature is enabled in settings
  • Check that background jobs are running
  • Verify sufficient memory for ML processing
  • Allow time for initial processing of large libraries

Slow Performance

  • Increase PHP memory limit if needed
  • Enable Redis caching for Nextcloud
  • Optimize database indexes
  • Consider allocating more CPU resources

Additional Resources

Conclusion

Deploying Nextcloud Memories on Klutch.sh gives you a powerful, privacy-respecting alternative to cloud photo services. With AI-powered face recognition, location mapping, and intuitive organization, you can manage your photo library without sacrificing control of your data. The combination of Nextcloud’s robust file management and Memories’ gallery features creates a comprehensive solution for photo storage and sharing.