Multiple projects in local Supabase #5968
-
|
Hi, When working with local Supabase (via Docker), I didn't see the option to add multiple projects. The cloud version has this possibility. Do you plan to add the ability to create multiple projects on Supabase locally? Or should I create multiple instances of supabase, each under a separate project that uses it?
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 28 replies
-
|
This was the last thing I’ve seen on this… |
Beta Was this translation helpful? Give feedback.
-
|
With multiple projects inside a local supabase out of scope and not an option moving forward will there be any complications running 2 or more local supabase stacks with docker running through the regular install/setup process? I'm trying to confirm before any dev time is spent on this. My curiosity on how this works limited to 1, and having to run multiple containers is in the container names, ports, db(db) user(postgres) exactly the same when composing up? We foresee in the near future needing the abstraction but also the ease to communicate back and fourth how we'd have them in production. Depending on the answer to the above question the following context may help. I'd prefer not in anyway manipulate the supabase clones if we must have several. The hope would be they all remain true to your deploy without alteration to avoid any migration or deployment issues. @GaryAustin1 any help would be appreciated answering the above 👍 Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
You can achieve it by running multiple instances of supabase docker image. It's not super convenient out of the box, but you can write a script to easily automate this.
Now you can have both instances running, one on :3000, with API on :8000. and another on :3100, with API on :8100, totally separate database and everything. (I only tested the basic usage, haven't fully tested if everything is working) |
Beta Was this translation helpful? Give feedback.
-
|
Would love to be able to specify the |
Beta Was this translation helpful? Give feedback.
-
|
I've found that updating the |
Beta Was this translation helpful? Give feedback.
-
|
@liyangguang @code-leen do these ways work with docker ? @liyangguang I am getting a lot of errors trying to change all the services ports as there are a lot of settings in the volumes with preset ports. I am sorry for asking stupid questions but I am new to docker and supabase and there is not much info about setting up multiple databases in the same server with supabase. |
Beta Was this translation helpful? Give feedback.
-
|
what you really want to do is run seperate networks on each of these services, keep config pretty much default |
Beta Was this translation helpful? Give feedback.
-
|
@code-leen could you expand please? I need some clarification on this approach. My primary use for Supabase at this time is for agent vector documentation retrieval via N8N. I'm sure I will have other uses for Supabase in the future. However, I do not intent to place Supabase in production use. It will solely be used in my local environment for personal use. |
Beta Was this translation helpful? Give feedback.
-
|
@code-leen you are absolutely right and this works for me. One issue with this local setup is some things still break in the studio like accessing the /api route. This way if you fail to copy the credentials from the terminal initially into the project, you will never see the details again which is not how the cloud works. The idea which is pretty bad, is to have a single instance per project. And then go into the toml file and update the port Anyway, thanks |
Beta Was this translation helpful? Give feedback.
-
|
I built a program to manage the deployment of multiple self hosted instances using docker. My contact info is in my profile, reach out if anyone is interested in getting a copy. |
Beta Was this translation helpful? Give feedback.
-
|
Anyone interested here to contribute to create a fork for this solution? would love to collaborate. Since so many people need this solution. |
Beta Was this translation helpful? Give feedback.
@znowfox @Geczy @martwozniak
I updated the port numbers and the
project_idin theconfig.toml. These values must be different between your projects so they do not conflict on your local machine. Theconfig.tomlcan be found at the '/supabase' directory in your project. This solution works for my use-case with having two different database instances utilizing Supabase, and I can see the two different sets of containers when viewing it in the Docker dashboard.After making changes to these files, the docs mention you will need to run
supabase stopandsupabase startfor it to work.Here is an example of how the
config.tomlfiles will look.Project 1: