Supabase self hosted won't connect to local postgres
I've been attempting to put supabase on my server self hosted, everything works fine (including when the db and supabase aren't decoupled), but when I decouple them and use the locally hosted postgresql, it won't connect.
I can connect through dbeaver fine, I tried with installing postgresql myself, and then deleted postgresql and the supabase folder. I reinstalled supabase from scratch, as well as installing https://github.com/supabase/postgres instead for the postgresql.
However still no luck...
10/Oct/2022:16:03:13 +0000: {"details":"connection to server at \"0.0.0.0\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n","code":"","message":"Database connection error. Retrying the connection."}
10/Oct/2022:16:03:13 +0000: {"details":"connection to server at \"0.0.0.0\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n","code":"","message":"Database connection error. Retrying the connection."}
time="2022-10-10T16:03:15Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=0.0.0.0 user=postgres database=postgres`: dial error (dial tcp 0.0.0.0:5432: connect: connection refused)"
time="2022-10-10T16:03:15Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=0.0.0.0 user=postgres database=postgres`: dial error (dial tcp 0.0.0.0:5432: connect: connection refused)"
I've tried different host names and ports. Eg.
localhost
localhost
,
0.0.0.0
0.0.0.0
,
127.0.0.1
127.0.0.1
, and
54322
54322
, but to no avail. On the previous install of postgres I created a new superuser with password etc. to see if it was a problem with that, but it wasn't, as well as creating a new database (editing env etc.)
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.