PocketBase is a completely opensource, completely free, self-hosted Firebase and SupaBase alternative.
This README contains instructions for getting PocketBase started as a service with a service account on Ubuntu with a Nginx reverse-proxy.
You could choose not to expose PocketBase to the web at all and only access the API from the server itself.
https://github.com/MrRedBeard/PocketBase-Implementation/blob/main/PocketBaseLinuxSetup.md
https://github.com/MrRedBeard/PocketBase-Implementation/blob/main/PocketBaseSDKImplementation.md
https://github.com/pocketbase/pocketbase