|Docs

Databases

Railway maintains its PostgreSQL, MySQL, Redis and MongoDB templates: it provisions them and ships security patches for their images. Converting one to high availability and turning on backups, point-in-time recovery (PostgreSQL, MySQL) and connection pooling (PostgreSQL) from the dashboard gives you a managed database in the sense what Railway manages describes. Railway shows database metrics and query statistics in the database view; alerting on them is yours to set up, and Railway does not publish an uptime SLA today. Schema, queries and data stay yours; database support scope says where support stops. You can also run any other database from a Docker image.

Getting started

The fastest way to deploy a database is through Railway's database templates:

DatabaseDescription
PostgreSQLThe world's most advanced open source relational database
PostgreSQL HAHigh-availability PostgreSQL cluster with automatic failover
PostgreSQL Connection PoolingPgBouncer connection pooler for Postgres and HA clusters
MySQLPopular open source relational database
MySQL HAHigh-availability MySQL cluster with Group Replication failover
RedisIn-memory data store for caching and real-time data
Redis HAHigh-availability Redis cluster with Sentinel failover
MongoDBDocument-oriented NoSQL database
MongoDB HAHigh-availability MongoDB replica set with automatic failover

Railway maintains these templates (the Redis template is owned by Redis) and they come pre-configured with sensible defaults.

What Railway manages

Railway maintains the database templates above (the Redis template is owned by Redis) and ships security patches for their images. The table lists which operations Railway handles and which stay with the user.

OperationWho
Provisioning, storage and networkingRailway
Security patches to the database imageRailway
Major version upgradesUser, one click for PostgreSQL
Backups and point-in-time recovery (PostgreSQL, MySQL)User turns them on
High availability and failover (PostgreSQL, MySQL, Redis, MongoDB)User turns it on; failover is then automatic
Connection pooling (PostgreSQL)User turns it on
Disk sizeUser resizes the volume
Schema, queries, indexes and dataUser

Database support scope

Support covers the template as Railway ships it and the platform it runs on:

  • provisioning, volumes and networking;
  • security updates to the database image;
  • the dashboard and CLI flows for backups, point-in-time recovery, high availability, connection pooling and major upgrades.

A database leaves this scope when the user changes:

  • the service's image, source, start command or the template's own variables;
  • its volume: the mount path, detaching or swapping it, or restoring a backup into it by hand;
  • the members of an HA cluster (replicas, proxies, consensus nodes) outside the dashboard and CLI flows;
  • files inside the container through SSH or a shell, such as the engine's config files or the data directory;
  • the database's own configuration through SQL rather than through Railway's dashboard or CLI: roles, settings, extensions, ALTER SYSTEM.

From then on the database is the user's to manage. Support still helps with the platform.

Schema, queries, indexes and the data are always the user's. Support does not configure a database for the user and does not make tuning, schema or query recommendations; the engine's own documentation, linked from each database page, is the reference.

Deploy any database

Railway isn't limited to the databases above. You can deploy any open source database by using:

  • Docker Images: Deploy any database available as a Docker image
  • Templates: Browse the database and storage templates for pre-configured options
  • Custom Builds: Build your own database service from source code

Explore these community and official templates in the marketplace:

  • All Storage Templates - Browse databases, caches, and storage solutions
  • ClickHouse, CockroachDB, Cassandra, ParadeDB, and more
  • Specialized databases like TimescaleDB, InfluxDB, and Neo4j

Platform features

Railway provides essential features for running production databases:

FeatureDescription
VolumesPersistent storage that survives deployments and restarts
TCP ProxyConnect to your database from outside Railway's network
Private NetworkingSecure, low-latency connections between services
BackupsScheduled and on-demand volume backups; point-in-time recovery for PostgreSQL and MySQL

Building custom database services

Need to run a database that isn't in the templates marketplace? Check out the guide on building a database service to learn how to configure volumes, networking, and persistence for any database.