Skip to main content
Version: In-Progress

Nextcloud Authenticated Sources

Gallery View supports displaying image collections directly from your personal or organization's Nextcloud server using an authenticated WebDAV connection.

This is separate from Nextcloud Shared Links because it connects using your Nextcloud account credentials or an App Password, granting full access to folders in your account without requiring public share links.

Requirements​

  1. Configure a Connection: Add a Nextcloud Connection in Gallery View plugin settings under Settings → Gallery View → Providers → Nextcloud Connections.
  2. Set a Key: Assign a short, unique key (such as nextcloud-demo or my-cloud) to your connection.
  3. Credentials: Provide your Nextcloud server base URL, username, and an App Password (recommended) generated in your Nextcloud Account settings (Settings → Security → Devices & sessions → Create new app password).

See Settings → Providers tab for step-by-step instructions on managing connection settings.


The nextcloud Source Schema​

All authenticated Nextcloud sources use the type: nextcloud schema. The connection key is required; all other fields (path, recursive, filters, sorting, limit) are optional:

sources:
- type: nextcloud
connection: nextcloud-demo
path: /Photos/Vacation
recursive: true
filenameFilter: "IMG_*"
filters:
mimeTypes:
- image/jpeg
- image/png
minSizeKb: 10
maxSizeKb: 5000
modifiedAfter: "2024-01-01"
modifiedBefore: "2024-12-31"
sort:
by: lastModified # name | size | lastModified
order: desc # asc | desc
limit: 50
view:
type: masonry
FieldTypeRequiredDescription
typestringYesMust be nextcloud.
connectionstringYesThe key of a Nextcloud connection configured in Settings → Providers.
pathstringNoFolder path on your Nextcloud server (e.g., /Photos, /Gallery-Demo). Defaults to /.
recursivebooleanNoWhen true, scans subdirectories recursively. Defaults to true.
filenameFilterstringNoGlob pattern for filename matching (e.g. IMG_*, *.png).
filters.mimeTypeslist of stringsNoFilter files by MIME types (e.g. image/jpeg, image/png, video/mp4). image/* and video/* match every image or video type.
filters.minSizeKbnumberNoMinimum file size in kilobytes.
filters.maxSizeKbnumberNoMaximum file size in kilobytes.
filters.modifiedAfterstring (ISO / YYYY-MM-DD)NoOnly return files modified after this date.
filters.modifiedBeforestring (ISO / YYYY-MM-DD)NoOnly return files modified before this date.
sort.byname, size, or lastModifiedNoField to sort files by.
sort.orderasc or descNoSort order. desc = descending.
limitnumberNoMaximum number of images to fetch.

Features​

  • WebDAV & Preview Integration: Uses Nextcloud's native WebDAV protocol and efficient core preview API to render lightweight thumbnails fast (for the thumbnail, masonry and justified views). Thumbnails keep each image's aspect ratio, so nothing is cropped.
  • Recursive Scanning: Discover images across subdirectories without manually listing each folder.
  • Filename Globs & MIME Filtering: Easily target specific file types or camera naming conventions.
  • Automatic Caching: Results are cached in memory for optimal performance and low server load.
  • Open in Nextcloud: Right-click a photo or video for Open in Nextcloud and Copy link, which link to the file in Nextcloud's web interface. Opening it needs you to be signed in to Nextcloud, in your browser, with access to the file.

Photos in formats galleries can't show (HEIC, TIFF, RAW and other image types) are left out, with a line under the gallery saying how many. With filters.mimeTypes, only the types you list are mentioned.

Videos​

Videos in the folder (MP4, M4V, WebM, MOV and OGV) are part of the gallery too. Each tile shows a still frame with a play icon; click it to play the video in the image viewer.

  • Still frames come from Nextcloud's own preview of the video. Nextcloud makes video previews only when the server has the Movie preview provider and ffmpeg; without them, a video up to 50 MB is downloaded once to take its frame (not on phones or tablets), and larger ones show a dark placeholder.
  • Playing downloads the whole video, so videos larger than Largest remote video to play in Settings (200 MB by default) aren't downloaded; the viewer offers Open in Nextcloud instead.
  • Length: Nextcloud doesn't report it, so the tile shows it after you have played the video once.

To show only videos, filter by type (video/* stands for every video type, image/* for every image type):

filters:
mimeTypes:
- video/*

Examples​

These examples use the nextcloud-demo connection to the public, read-only demo server. Add that connection to run them as they are, or change connection and path to your own.

sources:
- type: nextcloud
connection: nextcloud-demo
path: /Gallery-Demo/Landscapes
view:
type: masonry

2. Recursive Subfolder Scan with Camera Glob Filter​

sources:
- type: nextcloud
connection: nextcloud-demo
path: /Gallery-Demo/Camera
filenameFilter: "IMG_2024*"
limit: 20
view:
type: thumbnail

Troubleshooting​

  • Connection Not Found: Verify that the connection key in your YAML matches the connection key added in Settings → Gallery View → Providers.
  • Authentication Failure (401/403): Ensure your Nextcloud username and App Password are entered correctly. We recommend using a dedicated App Password from Nextcloud Security settings instead of your account password.
  • Path Not Found (404): Double check the folder path on your Nextcloud instance. Paths are relative to your user root (e.g., /Photos/Summer).