I've been using Trilium (https://github.com/zadam/trilium). There are desktop clients, no mobile clients. However the web interface works well enough for me that I don't mind. The notes update in near-realtime when you make edits through the web app on multiple machines (assuming internet connectivity of course).
If you're already self-hosting NextCloud you might want to look NextCloud Notes as well.
My only issue is that it does not have any widgets on Android. So, I use Nextcloud Notes when I need that. But Joplin is actually great. You can self host a joplin server or sync using a Nextcloud server. It supports advanced markdown and I like the UI as well.
You can try Bookstack, but it will work on a web browser only. Another option is Obsidian, but I think only the apps are FOSS, the backend is not.
I'm really enjoying Otterwiki. Everything is saved as markdown, attachments are next to the markdown files in a folder, and version control is integrated with a git repo. Everything lives in a directory and the application runs from a docker container.
It's the perfect amount of simplicity and is really just a UI on top of fully portable standard tech.
I'm a big fan of Logseq. I use Syncthing to sync a folder between my desktop and phone and it works great. Tagging, everything is in markdown, and it's easy to navigate around.
Honestly, the closest I have found is https://github.com/baggachipz/tinylist It looks like keep, can share and edit files with other people, which is something a lot of things are lacking and I use it extensively for that. Also, I don't like the recommendations of using MD apps/files for a simple checklist/random notes app. That's way too much for something this simple and I use Obsidian as well. But they serve much different purposes.
It allows you to host your own database for it, and there is a guide on it.
Memos is self hostable and is "cross platform" by nature of being web-based only. There is a 3rd party mobile app MoeMemos but it doesn't add anything special over the quite excellent progressive web app for plain Memos. Of course you can't use it offline since it's web-based. But I have an always on VPN connection between my phone and my server so home so it's fine.
Notesnook is recently open source, but as of yet not self hostable. It is on the roadmap though. This one is privacy/security oriented and has native apps for just about everything as well as a web interface.
Quillpad is the closest interface-wise to Keep, but it can only sync with Nextcloud and I can't run that beast on my old hardware. Too clunky and slow.
I've been on this hunt for awhile but I realized that I use Keep differently than other folks on the same journey. It's mostly a list focused service for me. Sometimes with check boxes, sometimes not. Most of the FOSS not taking apps can use some markdown, but that is a bear to use on mobile without a quick way to inject a checkbox. Memos has a button for a few formatting items on each "post" and thankfully one is the Markdown checkbox shortcut.
For notes, personal knowledge management, and everything else I use and love Obsidian.
Im using nextcloud notes and it works perfectly fine in browser/android app. Doesnt look good like google keep, but had no issues with it.
Recently I also started using memos, it looks like super simple private twiter and it has awesome android/ios app called MoeMemos. Not sure about encription, but it looks amazing
I'm really interested to see what you end up picking. I'm going through another phase of "find a new note taking tool" too. I can give you a few recommendations to try:
Obsidian is great on desktop, and okay on mobile. But it's really slow sometimes to open so not great for quick notes. I have a Tasker task/shortcut on my home screen that prompts me for a quick note and saves it to a md file in the vault directory without ever opening the obsidian app. Sync also isn't free unless you use a 3rd party plugin. There's a ton of plugins and some seem great, but there's no real built in security to protect you from malicious plugins afaik.
Joplin is okay, it has a great web clipper browser plugin. Syncing (at least over webdav) is painfully slow and doesn't happen in the background. The UI UX is pretty clunky but has been getting improved. Exporting from Joplin to markdown is annoying and not in a format usable by other tools. I ended up writing a script that uses the Joplin rest API to export all my notes with correct file names, frontmatter, etc. Otherwise they're random uuids and the metadata is at the bottom of the file.
Standard Notes seems alright so far. I'm pretty sure it's still electron, but hasn't felt too slow to me. It's the only app I've tried that has true end to end encryption where the notes are encrypted locally on your devices, not just in transit. Self hosting the sync server still requires a paid subscription to unlock most of the features like uploading files or using any note type other than plain text.
logseq scratches the emacs org mode itch, but doesn't have a mobile app out yet. It's an outliner by default too. I haven't used it much but it seems like it gets as much attention as obsidian does.
JTX Board, kind of a weird one but it's mobile only and uses caldav to create notes using the VJOURNAL format. I'm testing it with nextcloud. The app is pretty fast and usable offline so great for quick notes. It does have a lot of limitations though like not really being able to add large images or attachments. I also haven't found a good desktop or web app that uses the VJOURNAL standard.
TiddlyWiki - I really want to like it, it works offline and has several different methods of syncing changes. I haven't been able to get a good mobile syncing experience though, and it doesn't have a dedicated mobile app.
I juggle a lot of different note apps because I'm still looking for "the one", so always interested in seeing other's opinions!
I use Nextcloud with Carnet. I haven't used Keep in years so I don't know the current features but when I made the switch to Carnet it was very comparable.
On Nextcloud it is an app you install separately. For your phone you'll find Carner on f-droid. Sadly there is no client for iOS. Link https://www.getcarnet.app/
Might not the thing you are looking for, but I tried to find a replacement for Keep a year ago and somehow stuck with a todo.txt file.
It can be edited in a normal text editor but I use Markor and todo.txt on Android and Sleek on desktop. Sync is fine via your preferred sync tool.