VPS self-hosted supabase and local supabase sync issue

I have used dokploy supabase template to self-host on VPS. I have supabase running in my VPS. I am trying to sync my local supabase DB Schema & Data on my VPS supabase. I am using supabase db diff --schema public -f inital_schema --db-url="<postgres://<username>:<password>@<traefik host URL>:5432/postgres> But I am not able to connect to the server. Maybe it's TCP/IP connection issue. Has anyone successfully implemented supabase sync between local and self-hosted instances? Any material out there to help understand this process? Even if I can do it one time, I want some means to handle this with better Dev experience on an ongoing basis. Thanks for your help!
5 Replies
Rickson Lima
Rickson Lima3mo ago
Hey, did you solve it?
notruedev
notruedevOP3mo ago
No. Are you facing the same issue?
Luã Álvaro
Luã Álvaro3mo ago
i think there is because apps are not connected in the same docker networks. Im having the same issue trying to connect my next js app on supabase services
apis
apis2mo ago
You need to remove the comments on the following lines if you want to access postgres externally in docker-compose.yml
# ports:
# # Pass down internal port because it's set dynamically by other services
# - ${POSTGRES_PORT}:${POSTGRES_PORT}
# ports:
# # Pass down internal port because it's set dynamically by other services
# - ${POSTGRES_PORT}:${POSTGRES_PORT}

Did you find this page helpful?