Nextcloud: Install Preview Generator

This installation guide is tested with Nextcloud 11, 12 and 13.

Install the Preview Generator App

of the Nextcloud app store: apps.nextcloud.com/apps/previewgenerator

Install LibreOffice

apt-get install libreoffice libreoffice-l10n-de libreoffice-help-de

Install ffmpeg

apt-get install ffmpeg

Edit config.php

Add to /var/www/nextcloud/config/config.php

'preview_libreoffice_path' => '/usr/bin/libreoffice',
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
  0 => 'OC\\Preview\\Image',
  1 => 'OC\\Preview\\MP3',
  2 => 'OC\\Preview\\TXT',
  3 => 'OC\\Preview\\PDF',
  4 => 'OC\\Preview\\Movie',
  5 => 'OC\\Preview\\Photoshop',
  6 => 'OC\\Preview\\TIFF',
  7 => 'OC\\Preview\\SVG',
  8 => 'OC\\Preview\\OpenDocument',
),

Tested and working file formats

avi, bmp, gif, jpg, mp3, mp4, ods, odt, pdf, png, psd, svg, tif, txt.

First Run

sudo -u www-run php /var/www/nextcloud/occ preview:generate-all -vvv

Add Cronjob

crontab -u www-run -e
*/10 * * * * php /var/www/nextcloud/occ preview:pre-generate

Finished

Jahman!