Skip to main content
This page is archived. Fly Postgres (unmanaged) is no longer maintained, and Fly.io Support is not able to provide support or guidance for it. We now offer Fly.io Managed Postgres, our fully-managed database service that handles all aspects of running production PostgreSQL databases.These pages are kept for reference and are not listed in the navigation. The full set is indexed on the Fly Postgres (Unmanaged) page.
To connect to your Postgres database from outside your Fly organization, you need a WireGuard connection. However, flyctl on your local machine can connect using user-mode WireGuard magic, without you having to set up your own WireGuard tunnel. For a psql shell, you can just use the fly postgres connect command:
You can also forward the server port to your local system with fly proxy:
Then connect to your Postgres server at localhost:5432. Using psql again, as a trivial example, it would look like this:
If you already have something else listening on port 5432, you can run this instead:
Then connect to localhost:15432. As with all your Fly apps, you can get a root console on your app’s VM using fly ssh.