Connecting Self-Hosted Supabase to Softr
Hi, I set up a self-hosted Supabase DB and trying to connect it as a datasource to Softr. But didnt suceed yet. Who can help?
61 Replies
What connection string are you using?
for host i am using the domain i hosted supabase on. database is postgres, user and password i am using a super admin user that is defined in env file, and works for login. i also tried anon as user and the anon key as password, but it didnt work
I just watched this softr setting up with supabase video https://www.youtube.com/watch?v=3xckjKoi6pU. And just a quick search tells me that softr is only available on cloud and you can't self host it. So if you want to give access to softr, your self hosted db should be accessible over the internet
Refer to these screenshots. This is with n8n but the configuration process for db will be same except the hostname which will be the hostname you're serving your db on.
https://discord.com/channels/839993398554656828/1402924041693565018/1402986755111518248
Yes, I have Supabase self-hosted.
self-hosted + accessible over internet?
I have supabase also on cloud and its connected to softr, but I struggle to get the self hosted supabase connected to softr
Is your self-hosted instance accessible over internet?
yes, of course.
I am logging in via his domain
So lets say your domain is example.com. Now in the host, you'll add example.com
port will be 5432 and you'll have to open this port in your cloud's firewall, both incoming and outgoing connections
database: postgres
user: postgres.your-tenant-id (Do note that the user
postgres.your-tenant-id
, the value after .
comes from POOLER_TENANT_ID
env variable. By default it is your-tenant-id
)
password: db password will be present in your env variablesI added the port to the firewall on DO. created a tenant id, added all details, but still not working. the domain is on cloudflare, do i have to whitelist softr there?
What do you mean created a tenant-id?
You don't have to do anything extra
in my env file it wasnt mentioned
How are you self-hosting? docker-compose?
https://github.com/supabase/supabase/blob/master/docker/.env.example#L36
Actually DO has one in marketplace https://marketplace.digitalocean.com/apps/supabase
DigitalOcean
Supabase | DigitalOcean Marketplace 1-Click App
Supabase is an open source Firebase alternative.
I also installed Docker
The supabase service versions in this 1-click app are quite old. Also, I've never used this before so don't know how they've configured it.
Is a docker-compose.yml file present?
You can also try setting up an instance with my project supabase-automated-self-host. You just have to run a script and everything is configured automatically. You'll just need a server
i am checking your set up now
installation is super easy, can you help with this error? 431 Request Header Fields Too Large - i see it when entering the domain
Entering the domain where? In softr?
in the browser
works now, was caching
supabase is running. i can access but i didnt manage to connect it to softr yet.
Host: my-domain
Port: 5432
database: postgres
user: postgres.your-tenant-id
pw: db password
Wait, let me test it on my end.
@Yonatan I'm able to connect. Not facing any issues. What env variable are you using for db password
It has to be
POSTGRES_PASSWORD
You can try with my creds for testing.
host:
supabase.servehttp.com
password: b6b875f52ac37418773f74c14d98e4fd

yours worked. mine still dont work
Check your firewall.
maybe its cloudflare?

ports are open
I think in cloudflare you will also have to set dns only
i changed it to DNS only and still get this error: Something went wrong
Error while connecting to SQL Database: Failed to obtain JDBC Connection, The connection attempt failed.
Maybe try in a private window. Could be caching again.
Or first try to connect to self-hosted db with psql. See if that works
I used the IP instead of the domain and it worked
Then maybe cloudflare has still not updated the state
could be cached at their end
or in your browser which can be verified with private window
very nice installatio! super quick
thank you for your help, I like also the authentification
Thankyou. If its a production instance always use 2FA
Also I'd recommend to setup a subdomain for db connections. And set dns only for this subdomain
I have a subdomain but proxied, why is the dns only important?
https://community.cloudflare.com/t/what-is-the-difference-between-proxied-and-dns-only/173310/2
The upside of proxied is that you will enjoy the Coudflare benefits but you can not make a direct connection to your IP, which means any custom ports wont work.
yes, noticed now when trying to update supabase via n8n. so best to have the supabase on dns only? or for http requests a seperate subdomain?
Depends on what you're doing. If you want to make a direct connection to db, then you'll need to set dns only. If you're using REST api then you can use proxied mode as it uses http requests.
services like n8n or softr require direct connection so you'll need to use dns only mode for them
ok, thank you!
Hi, a different topic: do you know a self hosted to solution to download vimeo files and convert them to audio? the files are from my account, i just have more than 1000 and need an automation.
No idea about this, sorry
As you know I am using Softr. And I noticed that sometimes the data is showing very quickly there, but most of the times its not showing at all. Is Supabase overwhelmed, although CPU is at 20%?
Do I need to change any settings in the installation, like pool size?
I found lots of data in supabase regarding slow queries how to optimize
Are you talking about self-hosted supabase or cloud?
Self-hosted via your installation
The script doesn't modify any internals of supabase. I think this must be an issue with softr platform itself.
Ok, that helps. I will check with softr. Thank you
Is softr a good frontend solution for supabase? I have about 15 users that need access to data.
I've never used it so I won't be the best person to answer
do you recommend to increase the pool size?
Why do you think you have to increase the db pool size?
The data doesn't show in softr from time to time. Softr suggested to increase pool size.
Its not consistently quick showing data.
Trying to understand why and how to fix it, before I role out to users
I noticed that when n8n is adding new records (every 15min) the data doesn't show in softr, only a few min after it shows
Currently the connection is made via supavisor to supabase postgres db. Try this
In the docker-compose.yml file find out db service and add ports config
After adding the above config, comment out line 453

And then restart
You will have to change only the username on softr side. Now the username will just be
postgres
.
Do note that this way you're making direct connection to db.
Previously the connection was made via supavisor pooler in session mode. Maybe that could be causing issues.
If this doesn't fix the issue, then maybe softr has aggressive caching. After records are updated, open softr in another browser's private window and see if records are available in that windowOk I will check and let you know
Thank you
I didnt get it to work. At the moment I have vector unhealthy issues, after updating docker-compose.yml
What are the exact changes you made?
This is the how the changes should be made


I will check it tomorrow against your file.
You've not added ports config in db service and no need to comment out port 6543 on supavisor. Make sure to follow the screenshots
Could you share the whole docker compose yml?
Thank you again! With your file I found the errors, now data shows quick and smooth and consistant.
I guess I should increase security now
I guess softr is already using a pooler so supavisor was affecting it