Use NextCloud on a Linux server at home. It's FOSS, written in PHP. And with sophisticated web interface.
Use duplicated storage and/or COW filesystem (btrfs, zfs)
On the phone use NextCloud client with autoupload
And if you want constant sync regarding contacts, calendar entries, use DavX5 on the phone.
And if you want, use NextCloud extensions both the server side and on the phone. E.g. password manager. Tons of free extension exist.
All of the phone (for Android) can be reached on F-droid store
I hope this info will be useful :-)