# Railway Postgres pricing: what does it really cost? > An always-on Railway Postgres costs about $6, $36 or $145 a month at three sizes, and 3x that with HA. A $7 to $19 server runs the same database. Published 2026-10-09, updated 2026-11-16, by Nick Potts. For agents: [llms.txt](https://ployz.dev/llms.txt) indexes the Ployz docs as Markdown. **TL;DR:** An always-on Postgres on Railway costs about **$6 a month small, $36 medium and $145 busy**, before your app. RAM is most of that bill, so it grows with your data even when nothing else changes. - **High availability** runs three data nodes, so the database line roughly triples: the busy one passes $400. - **Backups** are cheap; point-in-time recovery adds bucket storage and upload egress. - **Connecting from outside Railway** costs $0.05 per GB of egress, including a frontend on Vercel and every `pg_dump`. - **The Free plan** won't keep a Postgres running all month. - **Stay on Railway if** the database costs a few dollars, or you want point-in-time recovery and failover. - **Move to your own server with Ployz if** the database is past about $20 a month and growing. A $7 to $19 server runs the same database next to your app. Your coding agent sets it up, and deleting its volume waits for you. Railway Postgres is an ordinary Railway service with a volume, running Railway's SSL-enabled Postgres 18 image. There's no database fee and no instance size; you pay for the RAM, CPU and disk the container uses, every minute it runs. ## What does an always-on Railway Postgres cost per month? With my assumptions, a small Postgres costs $6.30 a month, a medium one $35.50 and a busy one $145. **RAM is 55% to 80% of the bill** at every size. The volume, the thing people think of as "the database", is the smallest line until you're in the hundreds of gigabytes. | Line | Small | Medium | Busy | |---|---|---|---| | RAM | $5.00 | $20.00 | $80.00 | | CPU | $1.00 | $10.00 | $40.00 | | Volume | $0.30 | $3.00 | $15.00 | | Egress | $0.00 | $2.50 | $10.00 | | **Postgres usage** | **$6.30** | **$35.50** | **$145.00** | | Plan needed | Hobby | Pro (volume over 5 GB) | Pro | | RAM share | 79% | 56% | 55% | The three sizes, as average usage over a 30-day month: - **Small:** a side project. 0.05 vCPU, 0.5 GB RAM, 2 GB volume, no public egress. - **Medium:** a small business app. 0.5 vCPU, 2 GB RAM, 20 GB volume, 50 GB egress (an analytics tool, a few dumps, an admin client). - **Busy:** a SaaS whose database works all day. 2 vCPU, 8 GB RAM, 100 GB volume, 200 GB egress. These are assumptions, not measurements from my account. On Hobby, the small database alone uses more than the $5 credit, so your app's usage is on top of it. On Pro, the $20 credit is shared by every service in the workspace, so the medium and busy rows are what Postgres adds whatever else you run. This is the database half of my [Railway pricing breakdown](https://ployz.dev/blog/railway-pricing), which prices a whole app. ## What would your Postgres cost on Railway? Open your Postgres service's Metrics tab on Railway, read the average memory and CPU, check the volume size, and set the sliders. Egress means data leaving Railway: queries over the public URL, dumps, or a frontend hosted somewhere else. The defaults are the medium database. *The interactive calculator is on the web page: https://ployz.dev/blog/railway-postgres* ## How is Postgres billed on Railway? Like any other service: **$10 per GB of RAM** per month, $20 per vCPU per month, $0.15 per GB of volume per month and $0.05 per GB of egress. You pay for what the container holds, every minute it runs. Railway's [Postgres guide](https://docs.railway.com/guides/postgresql) says the template runs "Railway's SSL-enabled Postgres image, which uses the official Postgres image from Docker Hub as its base." The [template page](https://railway.com/deploy/postgres) pins it to Postgres 18. You get a container, a volume and connection variables like `DATABASE_URL`. Railway layers backups, point-in-time recovery, HA and PgBouncer on top. | Line | Rate | Source | |---|---|---| | RAM | $10 per GB-month ($0.000231 per GB-minute) | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | CPU | $20 per vCPU-month ($0.000463 per vCPU-minute) | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | Volume storage | $0.15 per GB-month | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | Network egress | $0.05 per GB | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | Volume backups | Volume rate, on the data only the backup holds | [Backups docs](https://docs.railway.com/volumes/backups) | | Storage bucket (used by PITR) | $0.015 per GB-month | [Railway pricing](https://railway.com/pricing) | The plan limits that matter for a database: | Plan | Fee and included usage | Max volume | Source | |---|---|---|---| | Free | $0, $1 of credit a month | 0.5 GB | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | Hobby | $5, includes $5 of usage | 5 GB | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | | Pro | $20, includes $20 of usage | up to 1 TB, self-serve | [Pricing docs](https://docs.railway.com/reference/pricing/plans) | Three rules from the [volumes reference](https://docs.railway.com/reference/volumes) shape how you run Postgres there: "Each service can only have a single volume", "Replicas cannot be used with volumes", and "there will be a small amount of downtime when re-deploying a service that has a volume attached, even if there is a healthcheck endpoint configured." The second is why HA is a separate cluster product and not a replica count. ## Why does the database dominate a Railway bill? Because Postgres is built to keep data in memory all the time, and memory is what Railway charges most for in practice. An app server can idle at a few hundred megabytes. A database with a working set of several gigabytes wants all of it in RAM, around the clock, at $10 per GB per month. Railway says it plainly: "you pay for allocated resources, not traffic," and "a server running idle still uses memory to stay loaded" ([understanding your bill](https://docs.railway.com/pricing/understanding-your-bill)). Railway's [Serverless sleep](https://docs.railway.com/reference/app-sleeping) doesn't help, because an open database connection keeps a service awake. That's my Railway story. I was paying $500+ a month and the bill went up every month, mostly from the database. It was hit hard and held a lot of gigabytes, and as it grew Postgres used more memory to keep up. I never changed a plan; the meter kept going up with the data. Today one dedicated server at €80 a month runs more than I ever ran on Railway. Two things make it worse than the table suggests: - **Postgres uses memory beyond `shared_buffers`.** It relies on the operating system's file cache to keep hot data in RAM. How much of that counts as your container's memory depends on the platform, but a busy database reading a large table pushes its memory use up over time. - **Every environment is another database.** A staging environment or a preview with its own Postgres is billed by the minute, at the same rates, for as long as it runs. The cheap fixes on Railway are a smaller `shared_buffers`, fewer connections, and deleting environments nobody uses. Each Postgres connection is a process with its own memory, which is what Railway's [PgBouncer](https://docs.railway.com/databases/postgresql-pgbouncer) option is for. None of these change the shape: a database that's doing well costs more every month. ## What do backups, PITR and high availability add? Volume backups are cheap. Point-in-time recovery adds bucket storage plus egress for every upload. High availability is the expensive one: three data nodes, each billed for its own RAM, CPU and volume, so the database line roughly triples. **Volume backups.** Railway takes them on a schedule you choose: "Daily - Backed up every 24 hours, kept for 6 days", "Weekly - Backed up every 7 days, kept for 27 days", "Monthly - Backed up every 30 days, kept for 89 days" ([backups docs](https://docs.railway.com/volumes/backups)). They're "incremental and Copy-on-Write", and you're "only billed for the incremental size of the backup." Even if the busy database's backups held a full extra 100 GB, that's $15 a month. When you restore, Railway mounts a new volume and "the previous volume will be retained but has been unmounted from the service", so delete it when you're done or you keep paying for it. **Point-in-time recovery.** Railway's Postgres image ships every WAL segment to a Railway storage bucket with pgBackRest, takes "a full backup every week and a differential backup every day", and keeps about four weeks ([PITR docs](https://docs.railway.com/volumes/point-in-time-recovery)). "There's no separate PITR fee", but it's billed through bucket storage and "network egress from the database service for the uploads." For the busy database, four weekly 100 GB full backups is over 400 GB of uploads a month before any WAL: about $20 of egress plus a few dollars of storage. pgBackRest compresses by default, so treat that as an upper bound. **High availability.** Railway converts Postgres into a cluster "backed by Patroni, etcd, and HAProxy" ([HA docs](https://docs.railway.com/databases/postgresql-ha)). The defaults are 2 streaming replicas "in addition to the primary", 3 etcd nodes and 3 HAProxy instances. Each data node needs the same memory as your primary to take over: | | Small | Medium | Busy | |---|---|---|---| | Single Postgres | $6.30 | $35.50 | $145.00 | | HA, three data nodes | $18.90 | $101.50 | $415.00 | | Plus | 3 etcd + 3 HAProxy services | same | same | The HA docs don't say what the etcd and HAProxy services use, so I left them out; they're small, but they're six more always-on services. If you go back to a single node, "the replicas' and etcd nodes' volumes stay in your project, unattached, and continue to count toward storage billing." I think HA is worth paying for if downtime costs you real money. But a busy database plus HA is how a solo developer ends up with a database bill in the hundreds. ## Does connecting from outside Railway cost extra? Yes. Any connection from outside Railway goes through a TCP proxy, and everything the database sends back is egress at **$0.05 per GB**. That includes a frontend hosted elsewhere, a GUI client like pgAdmin, a BI tool and every `pg_dump` from your laptop. Inside the same Railway project, the private `DATABASE_URL` is free. The [Postgres guide](https://docs.railway.com/guides/postgresql) says it directly: "You will be billed for Network Egress when using the TCP Proxy." Railway lists "not using private networking for databases" as a common cause of high bills ([understanding your bill](https://docs.railway.com/pricing/understanding-your-bill)). This bites hardest in a split stack, with the frontend on Vercel and the database on Railway. If a page reads 50 KB of rows and you serve a million of those pages, that's 50 GB, or $2.50. It's a line that grows with traffic, on top of a line that grows with data. If you're weighing a hosted database instead, I priced [Supabase](https://ployz.dev/blog/supabase-pricing) and [Render's Postgres](https://ployz.dev/blog/render-pricing) separately. Leaving costs egress too: moving a 20 GB database off Railway with `pg_dump "$DATABASE_PUBLIC_URL"` is about $1. ## Is Railway Postgres free? Only for a trial or a toy. The Free plan gives "$1 of free credit per month", 0.5 GB of RAM and a 0.5 GB volume per service ([pricing docs](https://docs.railway.com/reference/pricing/plans)). $1 buys about 100 MB of RAM running all month, so an always-on Postgres won't stay inside it. New accounts also get a one-time $5 trial credit. When the credit runs out, the docs say "your subscription will be cancelled" and "we will stop all of your workloads." For a database, that means your app is down until you pay. ## What does Postgres cost on your own server? A fixed monthly price for the whole server, whatever the database does with its memory. A Hetzner CX23 with 4 GB of RAM is **$7.09** a month with IPv4, and a CX43 with 16 GB is $19.09. Postgres, your app and Redis share the box, and the bill doesn't move as the data grows, until you outgrow the server. | Server | Specs | Monthly price | Source | |---|---|---|---| | Netcup VPS 500 | 2 vCPU, 4 GB RAM, 64 GB SSD, traffic included | €8.26 incl. VAT on a 12-month term | [netcup VPS](https://www.netcup.com/en/server/vps) | | Netcup VPS 1000 | 4 vCPU, 8 GB RAM, 128 GB SSD | €14.50 incl. VAT | Same | | Netcup VPS 2000 | 8 vCPU, 16 GB RAM, 256 GB SSD | €26.92 incl. VAT | Same | | Hetzner CX23 | 2 vCPU, 4 GB RAM, 40 GB NVMe | $6.49 | [Hetzner Cost-Optimized](https://www.hetzner.com/cloud/cost-optimized) | | Hetzner CX33 | 4 vCPU, 8 GB RAM, 80 GB NVMe | $9.99 | Same | | Hetzner CX43 | 8 vCPU, 16 GB RAM, 160 GB NVMe | $18.49 | Same | | Hetzner IPv4 | | €0.50, about $0.60 | [Hetzner docs](https://docs.hetzner.com/cloud/servers/overview/) | Hetzner prices are after its 15 June 2026 adjustment, before VAT, for Germany and Finland, with 20 TB of traffic included. Netcup has a US datacenter in Manassas. I'd look at Netcup first, because it gives more disk for the money, and the VPS 2000 has 256 GB for a growing database. | | Small | Medium | Busy | |---|---|---|---| | Railway Postgres | $6.30 | $35.50 | $145.00 | | Railway Postgres HA | $18.90 | $101.50 | $415.00 + etcd/HAProxy | | Own server | $7.09 (CX23) | $10.59 (CX33) | $19.09 (CX43) | I sized the servers so the app and the OS fit next to the database: the busy Postgres uses 8 GB of the CX43's 16. A shared Hetzner vCPU isn't the same as a Railway vCPU, so don't compare CPU counts one to one. At the small size Railway is cheaper by about a dollar, and it does more for you. What changes on your own server: - **A restore point comes with every database.** Deleting or detaching its volume waits for you. See the next section. - **Disk and memory charts come with it.** Ployz shows every server's disk, so a growing database doesn't surprise you. ## How do you back up Postgres on your own server? With Ployz, every database keeps a restore point, so after a bad migration you can restore it from the dashboard. If your coding agent tries to delete or detach the database's volume, the change stops and waits for you, and no setting turns that off. A copy on another server or off your servers is coming in Ployz; until then, if losing the server would hurt, keep your own `pg_dump` somewhere else too. To retire a server, move the database onto another one with seconds of downtime. ## Railway Postgres or your own server? **Stay on Railway Postgres if** your database costs a few dollars, you want point-in-time recovery, or you need a failover cluster and will pay for three copies. Railway's backup and PITR features are real and easy to use. **Pick your own server if** your database holds more than a gigabyte or two in memory, it's growing, or it's past about $20 a month on Railway. A $10 to $19 server runs what costs $36 to $145 on Railway, and the bill stays flat while your data grows. For every other fee on a platform bill, see [the hidden costs of PaaS pricing](https://ployz.dev/blog/paas-pricing). ## Where Ployz fits I built Ployz after my Railway database bill, to keep one-click Postgres and drop the meter. It turns a server you rent into a platform your coding agent runs. Paste one line into Claude Code, Codex or Cursor and it adds your server, ships the repo and sets up Postgres next to your app. The line is `Read ployz.dev/agents.md and deploy this repo to my server.` ```sh ployz up --server root@your-server ``` The database keeps a restore point. Deleting its volume waits for you, whoever asks. Metrics and searchable logs cover the database and the app in one dashboard. Ployz is free on any number of servers, and one is enough for both. [Deploy to your own server](https://ployz.dev/auth/github). ## FAQ ### How much does Postgres cost on Railway? About $6 a month for a small database, $36 for a medium one and $145 for a busy one, at $10 per GB of RAM, $20 per vCPU and $0.15 per GB of volume a month. High availability roughly triples it. ### Does Railway back up Postgres? Yes. Railway offers scheduled volume backups (daily, weekly or monthly) and point-in-time recovery through pgBackRest. You pay the incremental storage and the upload egress. ### Why is my Railway Postgres bill growing? Because Postgres keeps its working set in RAM, and Railway bills RAM by the minute. As your data grows, the database holds more memory and the bill follows, without any plan change. ### How do I move Postgres off Railway? Dump it over the public URL with `pg_dump "$DATABASE_PUBLIC_URL"` and restore it with `pg_restore` on the new server. A 20 GB database costs about $1 of egress to move. Where to move it, platform by platform, is in [Railway alternatives](https://ployz.dev/blog/railway-alternatives). ## How I checked Prices were checked on 16 November 2026 on Railway's [pricing docs](https://docs.railway.com/reference/pricing/plans) and [pricing page](https://railway.com/pricing), and on Hetzner's and Netcup's own pages, all linked next to each number. Railway bills in USD. The three database sizes are assumptions, not measurements from my account. Run Postgres next to your app on your own server with Ployz, free: [get started](https://ployz.dev/auth/github).