Nextcloud + Collabora or Onlyoffice

It depends the amount of users you are going to have editing files, If is just you, you can install collabora in docker in seconds, and making some small changes in the nginx config files could be done very quickly.

I prefer OnlyOffice, is harder to install, and very resource hungry, dont expect a raspberry to hold it. But if you are talking VM or even a second machine to do that, I already post an step by step guide to achieve it.

Hope it helps.