Skip to main content
Important: We are not able to provide support or guidance for unmanaged Postgres. We now offer Fly.io Managed Postgres , our fully-managed database service that handles all aspects of running production PostgreSQL databases.
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.