Install preview generator on nextcloudpi (raspberrypi 4)

NextCloudPi version|v1.15.3
NextCloudPi image|NextCloudPi_07-21-19
distribution|Raspbian GNU/Linux 10 \n \l
Nextcloud version
Raspberrypi 4

Hello everybody,

I would like to install the Preview Generator.

Currently I’ve used this tutorial:

Now I’m stuck at number 3.
[Run ./occ preview: generate-all once after installation.]

My command (GNU bash, version 5.0.3 (1) release):
pi @ nextcloudpi: ~ $ sudo -u www-run php /var/www/nextcloud/occ preview:generate-all -vvv

sudo: unknown user: www-run
sudo: unable to initialize policy plugin

What am I doing wrong?

Many thanks for your help

I just had the same issue so here is how I solved this.

By deleting the “-u www-run” part of the command, I obtained this error message:
Console has to be executed with the user that owns the file config/config.php
Current user: root
Owner of config.php: www-data
Try adding 'sudo -u www-data ’ to the beginning of the command (without the single quotes)
If running with ‘docker exec’ try adding the option ‘-u www-data’ to the docker command (without the single quotes)

So the following command worked fine:
sudo -u www-data php /var/www/nextcloud/occ preview:generate-all -vvv