Railway Postgres
Simple managed PostgreSQL without separate pooler configuration.
Railway offers managed PostgreSQL with a straightforward setup. It is a good option when you want a hosted database without configuring a separate connection pooler.
For local development, prefer Local (Docker).
1. Create a Railway account and project
Go to railway.app, create an account, and create a new project.
2. Add a PostgreSQL database
In the project, click New → Database → PostgreSQL. Railway provisions an instance for the project.
3. Get your connection string
Open the PostgreSQL service → Variables tab → copy DATABASE_URL.
4. Configure environment variables
Railway does not expose a separate pooler URL. Set both keys to the same connection string so migrate scripts (which read DIRECT_URL) still work:
DATABASE_URL="postgresql://postgres:[email protected]:port/railway"
DIRECT_URL="postgresql://postgres:[email protected]:port/railway"No special Prisma configuration is required beyond the kit’s standard PostgreSQL setup.
5. Run migrations
pnpm --filter @repo/database db:migrate
# or
pnpm --filter @repo/database db:push
pnpm --filter @repo/database db:generate6. Verify
pnpm devRailway Postgres includes automatic backups and usage-based pricing (Hobby plan starts around $5/month with included resources). Check Railway’s current pricing for details.
Frequently asked questions
Does Railway include connection pooling?
Not built-in. For many concurrent connections in production, consider adding PgBouncer or Railway’s TCP proxy — or use Neon / Supabase which ship poolers.
How much does Railway Postgres cost?
Usage-based. The Hobby plan starts at a low monthly floor; storage and compute are billed on usage. Confirm current rates on Railway’s site.