Connecting to Fly Postgres from Sprites (Sandbox Environments)

Hi team,

I’m trying to establish a connection to a Fly Postgres database from within a Sprite environment.

When attempting to connect using a private Fly hostname:

postgres://<user>:<pass>@<db-app>.flycast:5432/<db>

I encounter the following error:

getaddrinfo ENOTFOUND <db-app>.flycast

This suggests that the hostname is not resolvable from within the Sprite.


Clarification Needed

I would like to understand the expected networking behavior in this scenario:

  1. Are Sprite environments able to resolve and connect to Fly private hostnames such as .flycast or .internal?

  2. Do Sprites have access to Fly’s private network, or are they limited to outbound internet access only?

  3. Is there a recommended way to connect to a Fly Postgres instance from within a Sprite?


Any clarification on how networking is intended to work in this context would be very helpful.

Thanks!

Hi Nitturu,

Sprites are not in your Fly organization’s internal flycast network, so they won’t be able to see your Fly Postgres.

Options:

  1. Set up Wireguard on your sprite so it can talk to the Fly org’s network.
  2. Make your Postgres available via the Internet (mentioning for completeness but please don’t do this, not recommended, giant footgun).

Let me know if this helps!

  • Daniel
1 Like

Btw I made a script to make this process stupdily easy: https://lubien.dev/blog/sprite-fly-wireguard

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.