Can I access a postgres database of an app from outside?
-
@girish Ahh You mean the client (tool), where I connect to the database. I want to use TablePlus and I am sure it has ssh tunneling.
Hey @devtron .
I was curious about it too, so just tried the same using DBeaver.
I was able to successfully access Directus' Postgres database by:
- configuring SSH connection to the server that Cloudron is hosted on
- using:
- host = value gotten from the host server by using `docker inspect postgresql | grep IPAddress
- database = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_DATABASE)
- username = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_USERNAME)
- password = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_PASSWORD)
-
Hey @devtron .
I was curious about it too, so just tried the same using DBeaver.
I was able to successfully access Directus' Postgres database by:
- configuring SSH connection to the server that Cloudron is hosted on
- using:
- host = value gotten from the host server by using `docker inspect postgresql | grep IPAddress
- database = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_DATABASE)
- username = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_USERNAME)
- password = value gotten from Directus' 'terminal' (echo $CLOUDRON_POSTGRESQL_PASSWORD)
-
G girish marked this topic as a question on
-
G girish has marked this topic as solved on
-
Hi @girish .
I do have some feedback regarding the currently suggested method, as described in these new guides.
After using this method for quite a few days, finding the internal ip address of the db containers has almost become the Achilles heel for any operation that uses this feature. That's because, the internal ip address keeps on changing, every now and then.
And so far, i haven't been able to identify a way to connect to the db by a static name/ip/uri.
Would appreciate if a solution for that is posted as well!
Thanks.
-
Hi @girish .
I do have some feedback regarding the currently suggested method, as described in these new guides.
After using this method for quite a few days, finding the internal ip address of the db containers has almost become the Achilles heel for any operation that uses this feature. That's because, the internal ip address keeps on changing, every now and then.
And so far, i haven't been able to identify a way to connect to the db by a static name/ip/uri.
Would appreciate if a solution for that is posted as well!
Thanks.
-
@shrey that's a good point. I think docker can give those containers a different IP on each restart. For the app containers, we solved this by giving them static IPs. Maybe we should do the same for addons then.
-
@girish ideally an internal DNS mapping if dynamic, and an IP pattern to use if static, both of which should be viewable from the UI as needed.