Mintee
Mintee

Reputation: 845

What's the correct postgres url when hosting Supabase with Coolify?

Can't figure out what is the correct postgres url when hosting with Coolify. Everything is up and running. I have only changed the service name to db and kong domain to https://mywebsite.com:8000

Coolify is hosted on ubuntu vps_1 and through Coolify I deployed Supabase on ubuntu vps_2

What's the correct postgres url?

npx supabase db push --db-url "postgres://user:[email protected]:5432/postgres"

docker-compose.yml

.env.example

My environment variables:

POSTGRES_DB=postgres
POSTGRES_HOST=supabase-db
POSTGRES_PORT=5432
SERVICE_PASSWORD_POSTGRES=***

Upvotes: 2

Views: 2415

Answers (3)

Lars Moser
Lars Moser

Reputation: 26

With the default Coolify Docker Compose File its as followed:

Right under supabase-db (inside the Docker Compose File) you add the mapping (ports:) like that:

  supabase-db:
    ports:
     - '${POSTGRES_PORT}:${POSTGRES_PORT}'
    image: ...

Then under Firewall i.e. Hetzner you allow Port: 5432

Then you construct your url like the following:

postgresql://postgres:{POSTGRES_PASSWORD}@supabase-db:5432/postgres

Upvotes: 1

Samuel Teixeira
Samuel Teixeira

Reputation: 346

Edit the docker-compose file using the button: Edit Docker Compose

the button is located beside Service Stack

In the supabase-db section add the mapping:

ports:
  - '5433:5432'

This will expose the 5433 Example of JDBC connection:

jdbc:postgresql://user:pass@<your_ip>:5433/postgres

Remember to enable the 5433 port in your firewall if you have one.

Upvotes: 1

mubarak saeed
mubarak saeed

Reputation: 61

your url is correct npx supabase db push --db-url "postgres://user:[email protected]:5432/postgres" but you need to add port mapping in the compose file under the supabase-db image like

ports:
     - '5432:5050'
     - '9001:9001'

this worked for me

thought the port is soppose to map to database port to 5050 it did not but worked in the default port 5432.so do this exactly and use the same url with port 5432

Upvotes: 1

Related Questions