Nextcloud Docker Container - best way to run cron job

I found this advice to be the most helpful of them all, as anything else means meddling with dockerfiles and the like.

What is perhaps not mentioned very clearly is that this command needs to be added to the crontab of root on the host system.

sudo crontab -e

Add this line to your file:

*/5 * * * * docker exec -u www-data nextcloud php /var/www/html/cron.php

Close and save.

13 Likes