I honestly don't even know. I've used cryptpad before for other stuff which is open source, but probably wouldn't be good for writing a book. I guess you could use libre office.
But the big problem for me is that I have 5 kids and they never leave me alone so I rarely get time on my laptop, so I had to write most of this on my phone. Google docs was the quick and easy fix for that since there's a mobile app.