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

Created on Jul 9, 2024

44 total projects

37 active projects

92% success on recent deploys

Storage