# Cannot connect to a Digital Ocean hosted database after deploying

**URL:** <https://community.fly.io/t/cannot-connect-to-a-digital-ocean-hosted-database-after-deploying/2904>\
**Category:** Questions / Help\
**Created:** [October 22, 2021, 3:47am UTC](https://community.fly.io/t/cannot-connect-to-a-digital-ocean-hosted-database-after-deploying/2904 "2021-10-22T03:47:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [October 22, 2021, 1:36pm UTC](https://community.fly.io/t/cannot-connect-to-a-digital-ocean-hosted-database-after-deploying/2904/2 "2021-10-22T13:36:47Z")

</div>

Yes, you’re right it’s the IP that’s the issue.

Unfortunately the IP that Fly shows you is the one for _incoming_ requests to the app. They don’t reveal the outgoing IP. Which is what you need when using an external database that needs an IP.

Fly can provide an IP range for a particular region _but_ those IPs are subject to change. So that is half-way there but not ideal. I’m not aware of a solution to getting a fixed IP.

See e.g

> [@Allow traffic only from whitelisted IP addresses](https://community.fly.io/t/allow-traffic-only-from-whitelisted-ip-addresses/2782):
>
> Is there a way to allow traffic only from whitelisted IP addresses for an app? For example, in AWS we can use security groups to block all traffic except from a certain IP range (e.g. allow traffic only from Cloudflare IPs). This prevents a ton of traffic from bots.

> [@Best way to allow access to my app to only certain IPs](https://community.fly.io/t/best-way-to-allow-access-to-my-app-to-only-certain-ips/1137):
>
> Hello, I have been looking into running a UDP syslog server but would like to limit access to it to only certain IPs, naturally. Is there a best approach to doing this on fly? Since fly does not have the equivalent of an AWS security group (at the platform level) would it mean installing something like iptables in my Dockerfile? I have read bits about it which apparently gets complicated when running inside docker with the host having its own rules. For people that have IP-limited access bef…

---

_[View the full topic](https://community.fly.io/t/cannot-connect-to-a-digital-ocean-hosted-database-after-deploying/2904)._
