# Direct connect to the Discourse Database

**URL:** https://meta.discourse.org/t/direct-connect-to-the-discourse-database/115485
**Category:** Development
**Created:** [April 19, 2019, 5:17pm UTC](https://meta.discourse.org/t/direct-connect-to-the-discourse-database/115485 "2019-04-19T17:17:25Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2019, 5:47pm UTC](https://meta.discourse.org/t/direct-connect-to-the-discourse-database/115485/2 "2019-04-19T17:47:03Z")

</div>

> [@Shashikant\_Sharma](#):
>
> I need to how can I allow the Postgres port to be opened for my server to allow connection and fetch the data.

That’s almost certainly a bad idea. The answer is sort of “if you don’t know how, then you probably shouldn’t,” but there is an `expose` section in `app.yml` that you can modify. But then you’ll need to figure out how to do something about controlling access.

> [@Shashikant\_Sharma](#):
>
> I am looking for some custom aggregates and stats.

Have you considered the [Discourse Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566)? It’s safe, easy, and you can find plenty of [examples](https://meta.discourse.org/tags/data-explorer).

---

_[View the full topic](https://meta.discourse.org/t/direct-connect-to-the-discourse-database/115485)._
