← Databases
PO

Postgres

Tick Postgres on an app and Railyard creates a database, a role, and injects the connection details before the next build runs. Here is exactly what that gives you, what gets backed up, and how to reach it from outside.

What you get

  • Postgres 17, running in the pgvector/pgvector:pg17 image, so the vector extension sits right next to the regular relational engine.
  • One database and one role per app (app_<id>), with a generated password and the standard privileges on its own schema, not a shared login.
  • Optional extensions on request: pgvector, PostGIS, pg_trgm, hstore, pg_stat_statements and others from the supported list, installed without leaving the app's role with permanent superuser access.
  • Scheduled backups every 24 hours by default, each one confirmed by restoring it into a scratch database. At least the 7 most recent are always kept, and anything older than 30 days outside that set is pruned; both numbers are configurable per database.
  • Point-in-time recovery once it's turned on for the server: restore to any moment in the last 7 days, not just to a backup's timestamp.
  • A standby on a second database server (Pro and Team), checked every 5 minutes, with automatic failover if the primary stops answering for 3 minutes and the standby has lost contact with it too.

How to add it

  1. 1

    Tick Postgres when you create the app

    On New app, or later from Edit → Add-ons, check Postgres and deploy. Railyard creates the database and role and injects DATABASE_URL, DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USER and DATABASE_PASSWORD before the build runs.

  2. 2

    Or add it from the CLI

    railyard apps create <name> <git-url> --addons postgres does the same thing from a terminal, alongside the rest of the app's setup.

  3. 3

    Connect from your own machine

    Open Trusted addresses on the database card and allow your IP. Railyard opens a TCP proxy for that one address; psql, TablePlus or any other Postgres client can then reach it with the same password, and the card gives you the exact command to paste.

A one-click example

The official FastAPI starter pairs a React frontend and JWT auth with a Postgres database that's already wired in, a working example of the add-on running inside a real app rather than an empty database.

Or deploy a standalone instance deploys a standalone Postgres instance with nothing else attached, if that's all you need.

FAQ

What does Postgres cost on Railyard?
There's no separate line item. Postgres runs on the server you're already paying for, on your plan. A dedicated database server is its own server at normal pricing, and a standby for automatic failover needs Pro or Team.
How are backups kept, and can I restore one myself?
Every database on a database server is backed up on a schedule, 24 hours by default, and each backup is restored into a scratch database to confirm it's actually good before being marked verified. Restoring to the running app is one click from the database card, and point-in-time recovery adds restore-to-any-moment within the last 7 days once it's turned on.
How do I connect from outside, with psql or a GUI like TablePlus?
Open Trusted addresses on the database card and add your IP. Railyard opens a TCP proxy for that one address only; every other address stays blocked and the password is still required. The card shows you the exact connection string to paste.
How do I migrate an existing Postgres database in?
Point the app at the external URL under Resources → Use an outside service while you copy data across, or run pg_dump and pg_restore directly against the generated DATABASE_URL. Move off Heroku Postgres without losing data walks through a full cutover.

Tutorials that use it

General docs