Error message: "Attempt to write a readonly database"

Many thanks for reporting. Yes this is a known issue with Pi-hole v5 on current DietPi and has been fixed already for the upcoming release.

If users choose to install the webserver manually, then it might even run as a different user, hence adding www-data to pihole group would not change something. Of course in very most cases it's www-data, but guessing too much and relying on it, is probably not he best solution. Instead a clear documentation about the needs might be better.

I opened a PR to add some more information about what is required to do manually, when skipping webserver install through Pi-hole installer: web server question enhancements by MichaIng · Pull Request #3225 · pi-hole/pi-hole · GitHub