S
Supabase2mo ago
Acedia

How to use the supabase cli to connect to a local supabase docker instance ?

I can't see how it's done. I tried every command. Am I just dumb or am I missing something ? https://supabase.com/docs/guides/self-hosting/docker I used this to set everything up.
Self-Hosting with Docker | Supabase Docs
Learn how to configure and deploy Supabase with Docker.
12 Replies
silentworks
silentworks2mo ago
To connect how? what are you trying to do?
Acedia
AcediaOP2mo ago
I need to pull the schemas from that database. and To do that I need to use link, and to do that I need to use login.
silentworks
silentworks2mo ago
What does connect to it mean? please show the command you are trying to run supabase link only works with the hosted instance. If you are working with self-hosted or any docker variants then you use the --db-url flag and pass the db connection string to it.
Acedia
AcediaOP2mo ago
I did try it. didn't work. I am re-installing everything using the cli itself and see if it works better that way.
silentworks
silentworks2mo ago
It's best you explain what you are doing here, because I'm not sure how you would have a local supabase docker instance and still try to pull the db schema, where are you pulling the schemas to?
Acedia
AcediaOP2mo ago
Pull will just create a migration file. I will use the file for whatever I need it for obv. thanks for the help. I am re-installing everything rn and will mark as solved if I can connect to the db.
silentworks
silentworks2mo ago
What did you pass to the --db-url flag?
Acedia
AcediaOP2mo ago
database string
silentworks
silentworks2mo ago
Yeah what does it look like? it's local on your machine right? don't put the password in the version you will type here. Also did you try connecting to it via a GUI database tool like TablePlus, Beekeeper Studio, Datagrip or pgAdmin?
Acedia
AcediaOP2mo ago
No. just CLI.
silentworks
silentworks2mo ago
Try with a GUI database tool just to be sure you can actually connect. If it's not connecting then the local docker instance isn't exposing the port correctly.
Acedia
AcediaOP2mo ago
Sure. I am throwing the towel on this one. the cli installation is even worst than just cloning the fron git. will see other solutions.

Did you find this page helpful?