Self-Host
Can I connect a Self-Hosted instance of supabase to my normal bolt.new project?
13 Replies
You can but you'll have to expose your local instance to the internet. For that you can use https://github.com/unjs/untun. The downside is that everytime you rerun untun you'll get a new tunnel url which you'll have to update in your .env file. You can look into cloudflare tunnels and get a static url
If your self hosted instance is already exposed to internet, then use your domain. Here I'm using docker-compose setup and my local instance is available on localhost:8000



When using self hosted supabase, you cannot use these supabase integrations with bolt

Okay nice, once I connect it this way, it would just work normally as it always works with bolt.new right?
@inder
By the way, would this be possible in an easier way with any other vibe cosing tool like v0, lovable, cursor idk?
Im just wondering if this has this process because just bolt.new does not allow to do it easier or if it is just a general thing for all
Yes, i tested with CRUD operations on a table and authentication.
Sorry, i wont be the best person to answer this. I don't use AI vibe coding tools. I used bolt itself for the first time today.
Are you using supabase cli to setup local instance?
so I don't have developing experience but my idea is to build an app making use of no-code tools like bolt.new, supabase and n8n. Having both supabse and n8n hosted in a VPS (I have never done this process either but I fairly understand how to do it because I am a bit technical since I'm just starting to study software engineering)
Now, I don't really know what the best way to do so would be
But you already explained me how to connect bolt.new to self hosted supabase which is what I needed so that's enough, will come back if I need anything else
By the way, I think normal integration with bolt.new and supabase allows bolt agent to make use of functions and edge functions. Would this functionality also be working when connecting to self hosted one? @inder
You will be able to use your pre existing functions as when you use supabase js client to invoke a function its just an api call. I haven't tested creation of functions from bolt. I assume you will need to connect with supabase for creating functions which you can't do when self hosting supabase
hello @inder I connected my credentials of my own version of supabase which i have self hosted and it says it is doing what I ask it for but it does not create the table inside supabase or send the data when it is supposed to.
Also, maybe it could be because my connection is flagged as not secure, even thought it is https??



I believe for creating tables you'll need to integrate supabase with bolt but you can't do that with self hosted supabase. You can ask bolt to generate sql files and you can manually execute these files in sql editor or use supabase cli to set up the db
What is supabase CLI? Would that be like locally or what?
supabase cli can be used to set up db with migrations and seed data.
Based on your current setup with coolify it is better that you execute sql files in sql editor
hello @inder 
I found this github repo that allows to use MCP with your self hosted supabase instance for Cursor and many other AI tools.
https://github.com/HenkDz/selfhosted-supabase-mcp
This is my setup: hetzner VPS, self hosted Coolify and on coolify I installed supabase and linked it to my own domain.
When I try to run the dist command:
 I always get this same error:
Initializing Self-Hosted Supabase MCP Server...
Initializing SelfhostedSupabaseClient...
Checking for public.execute_sql RPC function...
Unexpected error checking for 'public.execute_sql' function: {
  message: 'TypeError: fetch failed',
  details: 'TypeError: fetch failed\n' +
............................(much more, does not fi tin message)
5)
    at async main (file:///root/selfhosted-supabase-mcp/dist/index.js:1710:30)
Initialization complete.
Supabase client initialized successfully.
No valid --tools-config specified or error loading config, enabling all available tools.
Initializing MCP Server...
Starting MCP Server in stdio mode...
MCP Server connected to stdio.
GitHub
GitHub - HenkDz/selfhosted-supabase-mcp: An MCP Server for your Sel...
An MCP Server for your Self Hosted Supabase. Contribute to HenkDz/selfhosted-supabase-mcp development by creating an account on GitHub.
It initializes but I miss the sql executing function
Have you verified the config? Used any other tool?