> ## Documentation Index
> Fetch the complete documentation index at: https://midplane.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fly Managed Postgres

> Connect a Fly Managed Postgres cluster to Midplane: a user with Fly's Reader role, its connection string, an SSH bastion in your Fly organization, and verified TLS.

Fly Managed Postgres has no public address, and its users can't create
roles. So Midplane reaches it through an SSH bastion in your Fly
organization, as a user with Fly's Reader role instead of the role script's.

**1. Create a Reader user**

On the cluster's **Users** tab, create a user with the Reader role: it
reads every database of the cluster and changes nothing. Clusters made
before July 2025 first opt in to Fly's roles there
([Fly's cluster configuration](https://docs.fly.io/postgres/cluster-configuration)).

**2. Copy its connection string**

Its host is `pgbouncer.<cluster id>.flympg.net` (keep PgBouncer in
session mode, Fly's default) or `direct.<cluster id>.flympg.net`. Paste
it as it is: the bastion resolves that name, and Midplane verifies the
cluster's Let's Encrypt certificate against it.

**3. Run a bastion in your Fly organization**

A small app with an SSH server and a public address, on the
organization's private network. Choose **Through an SSH bastion**,
allow your region's egress addresses to its SSH port, and add Midplane's
key line ([SSH bastions](https://midplane.ai/docs/connect/ssh.md)).

**4. Skip the role script**

It would stop at `CREATE ROLE`, for lack of `CREATEROLE`, and change
nothing. The Reader user already shows **Reads only**.

Fly installs `pg_stat_monitor` in `public`, whose view shows other
sessions' statements. Relations an extension owns stay closed to everyone,
whatever the review says
([what always stays closed](https://midplane.ai/docs/review.md#what-always-stays-closed)).

**Check:** **TLS verified**, the bastion's pinned host key under
**Network**, and **Reads only**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.