Illustration of hot air balloons carrying a Postgres elephant, servers, and other Fly.io hardware

Managed Postgres on Fly.io

If you like managing your own database, we have to ask: who hurt you? A database needs to "just work" and any time spent ensuring it does could be better spent… literally anywhere else. That's why Fly.io MPG exists.

Try It Now

Managed Postgres Database Management

Managed Postgres the Fly.io Way

Managed Postgres is our fully-managed database service that handles every aspect of running production PostgreSQL databases. We take care of:

  • Automatic backups and recovery
  • High availability with automatic failover
  • Performance monitoring, metrics, and logs
  • Resource scaling (CPU, RAM, storage)
  • Connection pooling with PgBouncer on every plan
  • Automatic encryption of data at rest and in transit
Try Managed Postgres

What You Get With Fly.io MPG

A highly-available Postgres cluster within your Fly.io organization's private network
Multiple databases and schemas on that cluster
Point-in-time restore from your automatic backups
A full catalog of trusted extensions including PostGIS and pgvector

We're releasing new features all the time! Watch this space.

Managed Postgres Protection
Global Availability

Where is Managed Postgres Available?

Amsterdam, Netherlands (ams)
Dallas, Texas, USA (dfw)
Frankfurt, Germany (fra)
São Paulo, Brazil (gru)
Ashburn, Virginia, USA (iad)
Los Angeles, California, USA (lax)
London, United Kingdom (lhr)
Tokyo, Japan (nrt)
Chicago, Illinois, USA (ord)
Singapore (sin)
San Jose, California, USA (sjc)
Sydney, Australia (syd)
Toronto, Canada (yyz)

If you don't see a region close to you in this list, hang tight! We're rolling Managed Postgres out to more regions as quickly as possible.

Flexible, Easy Storage

Starting size: 10 GB
Maximum size: 1 TB
Storage is replicated across all nodes in your cluster
Storage grows automatically with your data, so there is nothing to pre-provision
Flexible Database Storage

Scalable Pricing

Not having to manage your database? Priceless. But that's hard to budget for, so we'll just tell you what it costs: however much database storage you use (at $0.28/provisioned GB/month) plus whichever plan below works best for you.

Basic

$38.00 /mo

All plans include high availability, backups, and connection pooling.

CPU Shared-2x
Memory 1GB
Let's go!

Starter

$72.00 /mo

All plans include high availability, backups, and connection pooling.

CPU Shared-2x
Memory 2GB
Let's go!

Launch

$282.00 /mo

All plans include high availability, backups, and connection pooling.

CPU Performance-2x
Memory 8GB
Let's go!

Scale

$962.00 /mo

All plans include high availability, backups, and connection pooling.

CPU Performance-4x
Memory 32GB
Let's go!

Performance

$1922.00 /mo

All plans include high availability, backups, and connection pooling.

CPU Performance-8x
Memory 64GB
Let's go!

Getting Started

Create a cluster, attach it to an app, and get back to work. Attaching sets a DATABASE_URL secret on the app, pointed at the pooled endpoint that routes through PgBouncer.

fly mpg create
fly mpg attach your-cluster-id -a your-app-name

To open a psql session against the cluster, run fly mpg connect. To reach it from a tool running on your own machine, run fly mpg proxy and connect through the forwarded local port.

Read the full walkthrough in our docs

Frequently Asked Questions

What is Fly.io Managed Postgres? +

Managed Postgres is our fully managed database service. We run production PostgreSQL clusters for you and handle automatic backups and recovery, high availability with automatic failover, performance monitoring, resource scaling, and encryption of data at rest and in transit. You get a Postgres cluster inside your Fly.io organization's private network without doing the operational work yourself.

How do I create a Managed Postgres cluster on Fly.io? +

Run fly mpg create and pick an organization, a region, and a plan. You can also create a cluster from the Fly.io dashboard. Once it is running, fly mpg attach connects it to one of your apps by cluster ID and app name.

How does my app connect to Managed Postgres on Fly.io? +

Attaching a cluster with fly mpg attach sets a DATABASE_URL secret on your Fly.io app. That URL points at the pooled endpoint, which routes through PgBouncer so a busy app does not exhaust Postgres connections. To open a psql session yourself, run fly mpg connect.

Is a Fly.io Managed Postgres cluster reachable from the public internet? +

No. Your cluster runs inside your Fly.io organization's private network, so apps in the same organization reach it directly and nothing else can. From your own machine, connect through flyctl with fly mpg connect or fly mpg proxy, or over WireGuard.

Does Fly.io Managed Postgres include high availability? +

Yes. Every plan runs a primary and a replica with automatic failover, and storage is replicated across all nodes in the cluster. High availability, automatic backups, and connection pooling are included on every plan rather than sold as add-ons.

Which regions can I run Managed Postgres in? +

Managed Postgres runs in Amsterdam, Dallas, Frankfurt, Sao Paulo, Ashburn, Los Angeles, London, Tokyo, Chicago, Singapore, San Jose, Sydney, and Toronto. We are adding regions as capacity comes online, so check the Fly.io dashboard for the current list when you create a cluster.

Can I use pgvector and PostGIS on Fly.io Managed Postgres? +

Yes. Every Managed Postgres image on Fly.io ships pgvector for vector similarity search, and you can turn on PostGIS for geospatial work when you create a cluster or later from the dashboard. A catalog of trusted PostgreSQL extensions sits alongside them, including pg_trgm, hstore, citext, and pgcrypto.

How are backups handled for Managed Postgres on Fly.io? +

We back your cluster up automatically on a rolling schedule and keep those backups for ten days. fly mpg restore rebuilds a cluster from a backup or from a point in time into a new cluster on Fly.io, so recovering from a bad migration does not mean touching the original.

Can I run more than one database on a single Fly.io Managed Postgres cluster? +

Yes. A cluster starts with one database named fly-db and an admin user named fly-user, and you can add more databases, schemas, and users on the same cluster. On Fly.io, fly mpg databases and fly mpg users manage both from the command line.

Does Fly.io Managed Postgres support multi-region read replicas? +

No. High availability is within one region: a primary and a replica in the cluster's region, with automatic failover between them. For a globally distributed app, keep the database in a single region, spread your Fly.io Machines across the regions your users are in, and cache in front of the database rather than trying to run a replica everywhere.

Get Your Weekends Back with Managed Postgres

Get Your Weekends Back

Switch to Managed Postgres by Fly.io. Let us worry about database uptime while you go build something amazing!

Try Managed Postgres