How to run Nextcloud "php occ" in a docker-compose configuration
Use this command to run php occ inside a running docker Nextcloud container:
nextcloud_occ.sh
docker-compose exec -u www-data nextcloud php occ [command]where:
nextcloudis the name of your container in docker-compose-u www-datatellsdocker-composeto run the command as thewww-datauser that owns all the Nextcloud files.- Replace
[command]by thephp occcommand you want to run, for exampleversions:cleanup. If you want to see a list of all available commands, just omit[command]
Note: You need to run this command in the directory where your nextcloud docker-compose.yml is located.
Example:
example.sh
docker-compose exec -u www-data nextcloud php occ versions:cleanupor:
example.sh
docker-compose exec -u www-data nextcloud php occ trash:cleanup --all-usersCheck out similar posts by category:
PHP
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow