How to remove apps from nextcloud inside TrueNAS Scale

So for anyone else looking for a solution, this is what helped me. This forum post helped me a lot!

navigating to the shell

  • On your TrueNAS Scale, navigate to the Apps tab on the left. Look for nextcloud among your Installed Applications.
  • Open nextcloud’s three-point menu to access the shell. In the first drop-down menu, choose the pod that does not contain “postgres” or “cronjob” in the name. For container, choose nextcloud. Commands just said /bin/sh for me.
  • Click choose to open the shell.

get the right directory

  • Inside the shell, you need to find out where occ is located. For me, it was already the correct working directory. If it get’s listed when entering ls, you’re on the right track (Otherwise, navigate using cd and cd ..; I believe there is also some sort of find command, but it didn’t work for me)
  • If you found occ, just enter pwd and note what it prints, for me it was /var/www/html (i.e. the directory containing occ). Note that that is what I’m using in the following commands, so bear in mind to change it to your directory if it’s different to mine.

become root

  • enter su
    Instead of #, the input line should now be preceded by something like root@nextcloud...:/var/www/html#

enable maintenance mode

  • haven’t tried it without this, but I guess it is needed/recommended to enable maintenance mode. This should also keep other users from accessing nextcloud while you’re working on it.
  • enter su -m www-data -c 'php /var/www/html/occ maintenance:mode --on'
    If the console prints Maintenance mode enabled, it worked.

removing richtextdocumentscode

  • su -m www-data -c 'php /var/www/html/occ app:remove richdocumentscode' will disable and remove the app from your nextcloud. Note the documentation for details and more app-commands.
  • su -m www-data -c 'php /var/www/html/occ maintenance:mode --off' will disable maintenance mode. It might take a few minutes for the nextcloud login to work again.