How to shutdown NextcloudPi without Risk of data loss

In any computer there is ALWAYS risk of data loss if you just power down, as you already suspect.

The Raspberry Pi is no different, or maybe even worse because doing that is a recipe for SD card corruption.

Always sudo halt

That is enough to orderly shutdown your database, web server and everything else :slight_smile: