Independent reviews. IonBin has no partnerships with the tools on this page and was not paid for these listings. Our evaluations are our own, based on public documentation and our research. Product names are trademarks of their owners and are used for identification only. How disclosure works.

Question

How do I host an app and a database on Railway?

Verified Oct 17, 2026 Review by Jan 15, 2027 7 sources
Short answer

Create a Railway project, add a service from your GitHub repo (it deploys on push), then add PostgreSQL. Its connection variables, such as DATABASE_URL, are available to your other services. Schedule volume backups and set usage limits. Railway's MCP server lets AI assistants deploy and check services for you.

What it is

Railway is an app platform. A project holds services (your app, a worker) and databases, deployed without managing servers.

How it works

  1. Create a project and add a service from a GitHub repository. Railway deploys when you push to the connected branch, and you can change the trigger branch or turn autodeploys off.
  2. Add PostgreSQL, for example from a template. It exposes DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE to the project’s other services.
  3. Start from a template in the marketplace for common stacks.
  4. Protect the data. Railway backs up anything stored in a volume, including its databases. Backups can be manual or scheduled daily, weekly or monthly.
  5. Let agents help. Railway’s MCP server (mcp.railway.com) lets AI assistants create projects, deploy templates, manage environments, pull variables and redeploy. Railway also documents plugins and connectors for several AI coding tools and assistants.

Plans and limits (checked 2026-10-17). Hobby is $5 a month and Pro $20 a month, each including that much usage, with extra usage billed on top. You can set an email alert and a hard usage limit. At the hard limit Railway shuts down your workloads, so set it with care for production apps.

Benefits

  • Databases and services in one place, wired together with variables.
  • Deploys from GitHub with no server administration.
  • Agent-friendly: deploy, inspect logs and redeploy from a conversation.

Limits and risks

  • Usage-based billing. Set alerts and limits.
  • Back up what matters. Schedule backups for any database you can’t afford to lose, and test a restore.
  • Agent deploy access can change production. Use approvals.

Checked specs

Snapshot from official sources on Oct 17, 2026.

PostgreSQL variablesPGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, DATABASE_URL [1]
AutodeploysPushes to the connected branch deploy; trigger branch configurable; can be disabled [3]
BackupsManual or scheduled (daily, weekly, monthly) backups of anything stored in a volume [5]
Usage limitsEmail alert and hard limit; at the hard limit Railway shuts down workloads [6]
Plans (checked 2026-10-17)Free $0; Hobby $5/month including $5 of usage; Pro $20/month including $20 of usage [7]
MCP servermcp.railway.com, via the Railway CLI or OAuth; can create projects, deploy templates, manage environments, pull variables and redeploy [4]

Best-fit stacks

Stack 08

Dev, web & IT

Design, code, host and ship sites and internal tools, with an AI editor doing most of the typing.

Agent compatibility

Tool in this entryHow agents connect
Railway MCPAPI/CLI
GitHub MCPAPI/CLI

Levels come from each tool's recorded, sourced compatibility. How the levels work.

Sources

  1. PostgreSQL · Railwayofficial accessed Oct 17, 2026
  2. Templates · Railwayofficial accessed Oct 17, 2026
  3. Controlling GitHub autodeploys · Railwayofficial accessed Oct 17, 2026
  4. Railway MCP Server · Railwayofficial accessed Oct 17, 2026
  5. Backups · Railwayofficial accessed Oct 17, 2026
  6. Cost control · Railwayofficial accessed Oct 17, 2026
  7. Pricing plans · Railwayofficial accessed Oct 17, 2026

Practitioner views are restated in our words and labeled as views, not measured results. Product facts come from official sources dated above.

Suggest an edit

IonBin's wiki isn't user-edited. Corrections go to our Directory Curator, who checks them against primary sources before anything changes. Spot something wrong or out of date on “How do I host an app and a database on Railway?”? Email us with a link to a primary source.

Suggest an edit by email or write to [email protected]