# Connect to Postgres Read Replica Externally

**URL:** <https://community.fly.io/t/connect-to-postgres-read-replica-externally/6181>\
**Category:** Questions / Help\
**Tags:** postgres\
**Created:** [July 28, 2022, 4:07pm UTC](https://community.fly.io/t/connect-to-postgres-read-replica-externally/6181 "2022-07-28T16:07:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![td1](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/td1/32/4532_2.png) [@td1](https://community.fly.io/u/td1)\
**Post date:** [July 28, 2022, 4:07pm UTC](https://community.fly.io/t/connect-to-postgres-read-replica-externally/6181/1 "2022-07-28T16:07:02Z")

</div>

Hey all!

I’m attempting to connect an external visualization app to a read replica of my postgres instance. I’ve done the following

- Spin up a read replica
- Assign an IP address
- Expose the ports through this config:

```auto
[[services]]
  internal_port = 5432 # Postgres instance
  protocol = "tcp"

# Example of opening port 443 for secure connections
[[services.ports]]
  handlers = ["tls"]
  port = 443

# Example of opening port 10000 for insecure connections.
[[services.ports]]
  handlers = []
  port = 10000

```

That allows me to connect to the write replica. But if I try to point to the internal port at `5433` (which from my understanding [should point at the read replica](https://fly.io/docs/getting-started/multi-region-databases/#connect-to-regional-replicas)), the connection doesn’t work. I can, however, connect to the read replica through the internal connection (port 5433).

My goal is to only expose the read replica externally.

Any thoughts would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![geovanygameros](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/geovanygameros/32/7285_2.png) [@geovanygameros](https://community.fly.io/u/geovanygameros)\
**Post date:** [January 11, 2023, 10:02pm UTC](https://community.fly.io/t/connect-to-postgres-read-replica-externally/6181/2 "2023-01-11T22:02:32Z")

</div>

Hello @td1

I want to achieve the same, just to expose the read replica.

Did you find the solution?

---

<div class="post-metadata">

**Author:** ![owenhydra](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/owenhydra/32/18516_2.png) [@owenhydra](https://community.fly.io/u/owenhydra)\
**Post date:** [February 28, 2024, 6:40pm UTC](https://community.fly.io/t/connect-to-postgres-read-replica-externally/6181/3 "2024-02-28T18:40:59Z")

</div>

I want to the do the same thing to connect to the replicas externally. I would appreciate any help here.

Cheers,  
Owen
