How to Connect Your Railway PostgreSQL Database to Indiequery
Connect your Railway PostgreSQL database to Indiequery to query and explore data through a web interface. No desktop apps, no SSH. Just grab your connection details from Railway and connect in minutes.
Get Your Railway Connection Details
Log into your Railway dashboard at railway.app and navigate to your PostgreSQL service. Click the Variables tab to see your connection variables.
Railway generates these connection variables for you:
- PGHOST - Database hostname (proxy domain ending in
.proxy.rlwy.net) - PGPORT - Proxy port number
- PGUSER - Username (usually
postgres) - PGPASSWORD - Password
- PGDATABASE - Database name (default is
railway) Railway also provides full connection URLs (DATABASE_PUBLIC_URL for external connections and DATABASE_URL for internal Railway services), but you'll need the individual values to connect to Indiequery.
Connect to Indiequery
Go to app.indiequery.com and click Add Database Connection. Enter your connection details from the Variables tab:
- Host - Copy PGHOST (the proxy domain ending in
.proxy.rlwy.net) - Port - Copy PGPORT (from TCP Proxy, not 5432)
- Database - Copy PGDATABASE (default is
railway) - Username - Copy PGUSER (usually
postgres) - Password - Copy PGPASSWORD
- Keep "Require SSL" checked
- Name your connection (e.g., "Railway Production")
- Click Add Connection Indiequery tests the connection automatically. Once successful, start querying.
Use the Right Connection URL
Railway provides two connection URLs. For reference, always use details from DATABASE_PUBLIC_URL for Indiequery - the internal URL won't work from outside Railway.
DATABASE_URL (Internal) only works within Railway and uses a private domain. DATABASE_PUBLIC_URL (External) works from anywhere and uses a proxy domain ending in .proxy.rlwy.net.
Common Connection Issues
"Connection timed out"
Use connection details from DATABASE_PUBLIC_URL, not DATABASE_URL. Verify TCP Proxy is enabled in Settings → Networking, and use the proxy port from TCP Proxy settings, not port 5432.
"SSL connection required"
Railway requires SSL. Keep "Require SSL" checked in Indiequery.
"Authentication failed"
Copy PGPASSWORD carefully from the Variables tab. Passwords may contain special characters, so copy directly from Railway.
"Database does not exist"
Check the PGDATABASE value. The default is railway. Database names are case-sensitive.
Next Steps
Once connected:
- Browse database schema and tables
- Run SQL queries with autocomplete
- Create visualizations from results
- Save and reuse queries
- Build dashboards
- Share results publicly Head to app.indiequery.com and start exploring your Railway database.