Where to host a PostgreSQL database

By

Where to host a PostgreSQL database, from a local dev setup to a VPS or a managed service, and how to weigh the operational work each option demands.

~~~

When it comes to hosting the PostgreSQL database for your app you have many choices, and which one is perfect for you depends on your skills, your willingness to trade time for money (hosted solution or self-hosted solution), and your preferences.

The app-host choice (static, PaaS, VPS) is covered separately in where to host your web app. For a side-project cost comparison that also covers SQLite options like Turso and Cloudflare D1, plus Prisma Postgres, PlanetScale and Fly.io, see where to run Postgres or SQLite for a side project.

If you want to start without paying, I built a free free tier finder that lists all the $0 plans (databases included) filtered by what your app needs.

Before the list, one framing that makes the decision easier. A managed provider normally handles installation, patching, monitoring, backups, and failover. You still own schema changes, queries, access control, capacity, and restore testing — no provider knows your data. Self-hosting gives more control and a lower bill, but upgrades, storage, replication, security, and recovery become your job. Choose the operational work you are prepared to perform, not only the feature list.

Local database

FAST FREE REQUIRES SETUP LIMITED TO LOCALHOST

A local database is your best choice when you are developing your application on localhost.

Your application will be very fast on localhost if you use a local database, because the app does not need to look for the data on the Internet.

The drawback is the initial setup. I have a guide for macOS, and the official downloads cover Windows and Linux. Prefer PostgreSQL 18 when you pick a major version for a new local install.

This is important: the local database only works on localhost, as your computer is not accessible from the Internet. The moment you deploy anywhere public, you need a remote database. All the options below are reachable from anywhere.

Neon

FAST TO START FREE TIER NO SETUP SERVERLESS-FRIENDLY

Neon is managed Postgres built for serverless apps. You get a connection URL and point your app at it, and the database suspends when idle, so you don’t pay for compute nobody is using.

The Free plan (checked September 2026) gives you 0.5 GB of storage and 100 compute hours per project, up to 100 projects, and it’s permanent, not a trial. The Launch plan has no monthly fee and bills usage: $0.106 per compute hour and $0.35 per GB-month of storage.

If you deploy on Vercel, this is also what you get when you add Postgres from the Vercel Marketplace: Vercel Postgres was retired between late 2024 and early 2025 and every store moved to Neon. For wiring it into Kysely, see Connect to Postgres local vs Neon with Kysely.

Railway

FAST TO START NO SETUP USAGE-BASED PRICING

Railway is a good option to get up and running very quickly with a remote database. (That’s my referral link: sign up through it and you get $20 in Railway credit, and I get a 15% commission on what you pay in your first year.)

You click a button, you get a PostgreSQL instance and a connection URL. The pricing is usage-based: as of September 2026 the Free plan includes $1 of usage a month (enough for one small, mostly idle database, capped at 1 vCPU and 0.5 GB of RAM), and the Hobby plan costs $5 a month with $5 of usage included. Beyond that you pay about $10 per GB of RAM and $20 per vCPU a month, metered per second.

It has a nice user interface and it’s simple, which is exactly what you want while validating an idea.

DigitalOcean VPS

CHEAP REQUIRES SETUP YOU OPERATE IT

This is one of the best options when it comes to having your own server, with your own database, on the Internet.

The drawback is that you’ll need to learn how to set up and manage a Linux server: securing it, applying updates, watching disk space, planning major-version upgrades, and rehearsing restores. Skip this option if this does not excite you, because it can be a real time sink. If it does excite you, it is also the best teacher.

TIP: DigitalOcean also offers a managed database that makes things easier (but also costs more, save time spend more), see below.

DigitalOcean has great setup guides in its docs, like How To Install PostgreSQL on Ubuntu 24.04.

NOTE: I say DigitalOcean because I use and like that platform, but you could use any other VPS company. If you pick it, sign up with my referral link and you get $200 in credit for 60 days. This is an affiliate link: if you sign up through it and then spend $25, I get $25 in DigitalOcean credit.

The plus side is that if you have your own VPS for the database, you can also host the app on there. Both the app and the data live on the same server, which removes network latency between them. And you can scale up the server as you need.

DigitalOcean Managed Database

PAID NO SETUP BACKUPS INCLUDED

I already talked about DigitalOcean in terms of hosting your own VPS.

This is different - they host the database without you having to set up or maintain anything. The smallest PostgreSQL cluster (1 vCPU, 1 GiB of RAM, 10 GiB of disk) costs $15.15 a month as of September 2026.

I think this is a great solution to host all your applications and have peace of mind, as you do not have to worry about your server, maintenance, being hacked, and so on. You pay by the hour, so you can test it and then shut it down.

They provide daily backups and a connection pooler, which helps when your platform runs serverless functions that would otherwise exhaust the database connection limit.

One thing no managed provider does for you: proving the backups restore into something your app can use. Restore one into a scratch database once in a while and point the app at it.

Supabase

FREE TIER CONNECTION POOL NO SETUP

Supabase is a very interesting project. It’s not “just a database hosting” but it’s also one, so you can use it as that. It’s an app development platform built on top of PostgreSQL, and it includes a connection pooler, again useful with serverless platforms.

The free tier is enough to try it seriously: 500 MB of database, two active projects, and the project pauses after a week without traffic (September 2026). The Pro plan starts at $25 a month and includes daily backups. Supabase markets itself as a Firebase alternative, and in addition to the database you have authentication, realtime subscriptions, storage, and a lot more you can explore later on.

NOTE: Supabase can also be self hosted, at the expense of having to manage your own infrastructure

AWS RDS for PostgreSQL

PAID NO SETUP COMPLEX

An optimal solution if you’re already using AWS. The AWS Free Tier covers 750 hours a month of a small Single-AZ instance plus 20 GB of storage for the first year on a new account.

This is a bit more complex to set up than the other hosted solutions, being AWS, but it’s also a managed solution, so you don’t need to worry about managing your own server.

Like for DigitalOcean, you could also use AWS EC2 to host your VPS on Amazon AWS, and install PostgreSQL on that.

How I’d decide

For development, local. For a first deployment, a managed option with a connection pooler, because the operational work you skip is worth more than the price difference. Self-host on a VPS when you either want to learn server administration or you have enough traffic that the managed premium starts to matter — and in that case, budget real time for backups and upgrade drills, because whoever hosts it, the restore test is always yours.

Tagged: Database · All topics

Want me to talk about your product? You can sponsor this site.

~~~

Related posts about database: