How to connect a local Hasura instance with

I’ve just spent an unnecessary amount of time figuring out how to connect my locally running Hasura docker instance with the local postgres database started by Therefore I’m sharing the solution here.

When adding a new data source in Hasura’s console:

  1. Select Database URL as Data Source
  2. Enter the following inside the Database URL field:
  1. Replace USERNAME with your system user name. If you don’t know what it is, run the command whoami in the terminal app.

The part I got stuck with was replacing localhost as the database url with host.docker.internal, since that is what docker requires. Luckily Hasura itself had this information buried in one of their blog posts.

Maybe this saves somebody out there some time. ✌️