Maybe Syncthing with file versioning? Use ECC memory if possible to reduce chances of corruption. The cloud can also fail, your concerns are not exclusive to self hosting.