Connect From a Fly App

Connection string URIs are a common way to describe a connection to a Postgres server. The output from flyctl postgres create provides a connection string of the format:

postgres://{username}:{password}@{hostname}:{port}/{database}?options

Fly Postgres is an app that belongs to your Fly organization. The hostname in this string resolves to an internal IPv6 address that can be reached by any of your apps that live in the same IPv6 private network.

You can give this connection string to another Fly app by passing it as a secret, or by Attaching it.