NextCloud Slow in public ip and work perfectly in lan

May I ask please if there is a way to disable CODE from terminal or DB directly?

What exactly do you want to achieve?

If you don’t want to use Nextcloud Office / Collabora, just disable or uninstall the corresponding apps. You can do this via the web ui, no need to go to the terminal and you certainly don’t need to access the database directly in order to uninstall an app.

It takes ages even to load the GUI so want to disable/remove what it might causing this as per this thread.

You can use the occ command to disable or remove apps:

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#using-the-occ-command

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#apps-commands-label