Connecting to postgresql database remotely

312 views Asked by At

how to Connect postgresql using bookshelf.js from a remote system instead of using "host: localhost"

1

There are 1 answers

0
flaviodesousa On

Use the hostname or IP address of the host, instead of 'localhost', like:

host: "dbserver.example.com"

or

host: "203.0.113.1"

Note: if the database is not using the default port (5432) you should also specify it. For example for port 5050:

host: "dbserver.example.com:5050"

or

host: "203.0.113.1:5050"