As another commenter mentioned, TrueNAS is my go-to for general storage and phone/PC/Mac backups; it's dead simple to setup and is extremely capable, not to mention it'll run on just about anything (barring the ZFS cache RAM requirements...). Personally, I keep a 'master' home folder on there that gets auto-mounted in whatever OS I boot into; this way I never have to go hunting around the NAS for files, for instance I just have a single "Documents" folder that effectively 'syncs' across my Mac, *nix, and Windows. I use CX File Explorer on Android to access the NAS, add a WireGuard VPN (which there's a great plugin for on TrueNAS) and you've got access to your files anywhere.
GDrive I was able to replace more or less with LibreOffice and Collabora, I rarely need to share documents outside PDF or print, which makes compatibility a non-issue for me (and even when I need to, saving as a .doc usually maintains layouts, fonts, etc.).
Nextcloud is pretty great. I use it for file storage/sharing, contacts, calendar, and notes. There is a way to run a GDocs clone on it as well but I have no need for an office suite.
GDrive I was able to replace more or less with LibreOffice and Collabora, I rarely need to share documents outside PDF or print, which makes compatibility a non-issue for me (and even when I need to, saving as a .doc usually maintains layouts, fonts, etc.).