How to run Nextcloud "php occ" in a docker-compose configuration

Use this command to run php occ inside a running docker Nextcloud container:

example.sh
docker-compose exec -u www-data nextcloud php occ [command]

where:

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:cleanup

  or:

example.sh
docker-compose exec -u www-data nextcloud php occ trash:cleanup --all-users

 


Check out similar posts by category: PHP