Are multiple in-sync servers possible?

Does anyone know of a good way (or if it is possible/built-in already) to run multiple servers on my LAN and keep them in-sync?

I have an ubuntu VM running nextcloud on my main home PC, ideally I would like to setup another instance of nextcloud where the files are always in sync, they use the same database, and in the event that my main PC goes down then the server would redirect to my backup instance.

In older versions, the documentation gave a few deployment recommendations for multi-server setups:
https://docs.nextcloud.com/server/9/admin_manual/installation/deployment_recommendations.html#mid-sized-enterprises

For your purpose, you could check how you keep a hot-swap server updated (database and data in sync) and how you switch.