Disclosure: we may earn a commission or referral reward from CloudCone, Contabo, DigitalOcean (account credit, not cash), Hostwinds, InterServer, RackNerd, VPSDime and Vultr if you sign up through our links. It does not change the price you pay. Every other provider pays us nothing. Prices in this guide are as of the date shown and may have changed; see the comparison pages for the latest checked prices.

Guides · FOR

Best hosting for a Postgres database server in 2026

Some prices quoted in this guide are out of date. It is being rebuilt on our price index; for current prices use the comparison pages, which show when each price was checked.

Running Postgres on your own VPS is dramatically cheaper than any managed Postgres service, and if you're technical, it's straightforward. The trade-off is real: managed Postgres handles backup, point-in-time recovery, replica failover, and monitoring for you. On self-hosted, all of those are your problem.

Prices as of 2026-09-22.

Self-hosted vs managed at every tier

Tier Self-hosted (Hetzner) Managed (DO Postgres) Ratio
1 GB / 1 vCPU CX22 $4.60 (4 GB, 2 vCPU!) $15/mo 3x DO more
4 GB / 2 vCPU CX22 or CX32 $4.60-7.60 $60/mo 8-13x DO more
8 GB / 4 vCPU CX32 $7.60 $105/mo 14x DO more
16 GB / 4 vCPU CX52 ~$28 $240/mo 9x DO more

Managed Postgres pricing includes backups, HA, monitoring, and Point-in-Time Recovery. Self-hosted pricing does not.

What Postgres actually needs

  • RAM: 25-40% of your working set fits in shared_buffers. For a 4 GB VPS: shared_buffers = 1GB. For an 8 GB: shared_buffers = 2GB.
  • Fast NVMe storage. Postgres write latency is bound by fsync; SSD/NVMe helps considerably.
  • A vCPU for connection handling. Each connection is a process. Use PgBouncer if you have >50 concurrent connections.
  • Backup destination separate from the DB server. Never keep backups on the same host.

Recommended picks

Small production Postgres ($5-10/mo)

Hetzner CX32 at $7.60/mo — 4 vCPU, 8 GB RAM, 80 GB NVMe.

Install Postgres 16 from the PGDG apt repo. Configure shared_buffers = 2GB, effective_cache_size = 6GB, work_mem = 32MB. Set up daily pg_dump to Backblaze B2 or DO Spaces.

Or Contabo Cloud VPS 4 at $7.79/mo — 100 GB NVMe if you need more storage per dollar.

Managed Postgres, small ($15/mo)

DigitalOcean Managed Postgres 1 GB at $15/mo. Includes automatic backups (7 days), Point-in-Time Recovery, standby replica available. Best entry-tier managed Postgres pricing.

Managed Postgres, medium ($60-105/mo)

DO Managed Postgres 4 GB at $60/mo. Real HA with failover, standby replicas configurable.

Data-heavy Postgres self-hosted ($20-30/mo)

Contabo Cloud VPS 6 at $10.62/mo — 6 vCPU, 12 GB RAM, 200 GB NVMe. Or Contabo Cloud VPS 8 at $19.82/mo for 8/24/300. Enormous storage per dollar.

Or Hetzner CCX23 (dedicated) at ~$32/mo — 4 dedicated vCPU, 16 GB RAM, 160 GB NVMe. No oversubscription. Best consistency for a real production Postgres.

Postgres tuning shortcut

Use pgtune.leopard.in.ua to generate postgresql.conf for your machine size and workload. Copy the output. It's better than default and better than what most people would guess.

Backup strategy for self-hosted

Absolute minimum:

```bash

Nightly full dump to remote storage

0 3 * pg_dump -F c -Z 9 mydb | rclone rcat b2:my-backups/db-$(date +%Y%m%d).dump

Weekly retention: keep 30 days

0 4 * find /backups -mtime +30 -delete

```

For Point-in-Time Recovery: enable WAL archiving to remote storage. pg_wal files get shipped to B2 or S3 continuously. Recovery walks through WALs.

When to move to managed Postgres

  • Your business depends on the DB not going down. Managed HA is real.
  • You've had one incident where you learned that backup discipline was worse than you thought.
  • Your DB size approaches the point where a bad restore takes hours. Managed PITR is minutes.
  • Regulatory or SOC 2 compliance requires documented backup schedules and audit logs.

When to keep self-hosting

  • Cost matters and you have the technical discipline.
  • Your DB is small enough that pg_dump + rclone is trivially fast (<30 min).
  • You're the only technical person, and adding managed DB is $60/mo you'd rather spend on other things.
  • You've done a restore drill in the last 90 days and it worked.

Which one you should actually pick

  • Learning / small side project → Hetzner CX32 at $7.60/mo self-hosted.
  • Small production, cost-first → Hetzner CX32 or Contabo Cloud VPS 4 self-hosted + rclone backups to B2.
  • Small production, ops-first → DO Managed Postgres 1 GB at $15/mo.
  • Medium production with real reliability requirements → DO Managed Postgres 4 GB at $60/mo with a standby replica.
  • Data-heavy, cost-first → Contabo Cloud VPS 8 at $19.82/mo (300 GB NVMe).
  • Consistency-critical → Hetzner CCX dedicated line.

Related guides

Prices as of 2026-09-22.