Deploy PostgreSQL
Run PostgreSQL 16 on Railway with Docker, volume-ready defaults.
railwayapp-postgresql
Just deployed
PostgreSQL for railway.app
Deploy PostgreSQL 16 on Railway with the official Docker image.
Environment
| Variable | Required | Description |
|---|---|---|
POSTGRES_PASSWORD | Yes | Password for the postgres user |
Optional
| Variable | Description |
|---|---|
POSTGRES_USER | Defaults to postgres |
POSTGRES_DB | Defaults to postgres |
Persistence
railway.toml declares requiredMountPath = "/var/lib/postgresql/data". Attach a Railway volume to that path before production traffic — Railway will prompt for it based on this setting, but it is not created automatically.
Local
docker build -t railwayapp-postgresql .
docker run --rm -e POSTGRES_PASSWORD=dev -p 5432:5432 railwayapp-postgresql
Template Content
railwayapp-postgresql
vergissberlin/railwayapp-postgresql