All Templates / Storage

PostgreSQL

PostgreSQL

PostgreSQL database with data persistence and TCP Proxy

Deploy PostgreSQL

Postgres

railwayapp-templates/postgres-ssl:latest

Just deployed

/var/lib/postgresql/data

Overview

PostgreSQL database service, deployed with Railway's official SSL-enabled image.

  • A volume is mounted to the service to persist data between builds.

  • TCP proxying is configured to allow accessing the database from anywhere.

How to use

Reference the DATABASE_URL variable from your service to connect to the database in your tool of choice (e.g. ${{Postgres.DATABASE_URL}})

Connecting

Connect to the database using the proxied domain and port found on the service settings page. The password can be found on the Variables page.

In a terminal, for example:

psql "postgres://railway:PASSWORD@PROXY_DOMAIN:PROXY_PORT/railway"

Deploy Now

Details

Railway Templates

Created on Sep 7, 2023

27593 total projects

18914 active projects

100% success on recent deploys

Storage



More templates in this category

View Template
ReadySet

ReadySet

A lightweight caching engine for Postgres


Milo

View Template
EdgeDB

EdgeDB

EdgeDB template based on their Docker deployment guide


Ajit Krishna

View Template
Apache Kvrocks

Apache Kvrocks

A drop-in replacement for Redis to store data on a volume.


Bram