Run occ in nextcloud

Ok, that changes things. Docker commands do not work with the current apps system in 24.04.x, which is built on Kubernetes.

When you said docker I presumed you were either running it as a jail or in the 24.10-beta, which will change from Kubernetes to Docker, my mistake.

Kubernetes is more complicated but here’s a summary from another user who also had issues running commands in the nextcloud container in TrueNAS.

You run those in the TrueNAS shell and will likely need to prefix your commands with sudo. Obviously modify the last part of the command (with the php-bit) to do what you want to happen in the container.