Managed Postgres

Your Railway data, where work happens.

Railway Postgres over the public TCP proxy. Two variables look like the right one and only one of them is — the card knows which.

Use the results in Excel, Google Sheets, AI tools and your apps through the Database REST API.

Every connector type is on Free. Start with 2 data sources and 1 agent.

RailwayYour existing database connection
Inside your networkQuery Streams Network Agent

Run read-only queries inside your network.

Read-only queries · outbound connection

Source credentials stay on the agent. Your tools receive query results.

Source → agent → allowed results

Query Streams reads Railway Postgres from Microsoft Excel, Google Sheets, Power BI, AI assistants over MCP and a REST endpoint through one read-only connection. Railway gives every database two addresses: a private one that only resolves inside Railway, and a public TCP proxy for everything else. The Network Agent runs outside Railway, so the public proxy is the one that works — and because the private variable is the one Railway shows you first, the card rejects it by name rather than letting it fail as a timeout.

  • Public proxy, not the internal host
  • Per-service port, never assumed
  • Encrypted, self-signed certs allowed

Connect Railway with the right settings.

Keep the connection on the Network Agent. These are the details specific to Railway.

Host
<name>.proxy.rlwy.net, the public TCP proxy. Older deploys on .railway.app also work
Port
Assigned per service by Railway. No default — it comes from DATABASE_PUBLIC_URL
Driver
Npgsql, carried by the agent — nothing to install at the Railway end
Paste format
DATABASE_PUBLIC_URL from the service Variables tab
Database
railway, which is Railway's default name for it
Username
postgres
TLS
Required, and forced by the agent for Railway hosts. Encrypted; the certificate chain is not verified, which is what Railway's self-signed certificate needs
Pooling
None. The agent applies no pooler adaptations for Railway
Not this card
The .railway.internal private hostname — the card rejects it and tells you which variable to use instead
Saved as
PostgreSQL, with Railway kept as a badge — there is no connection type called Railway
Default schema
public, which is what a federated reference carries

The private-versus-public variable is the whole story of this card. Railway shows DATABASE_URL prominently and it is the correct variable for services running inside Railway, which is most of what Railway is for. An external reader is the exception, and the exception needs the other variable. Rejecting the internal hostname by name — rather than letting it resolve to nothing and time out — is the difference between a five-second correction and twenty minutes of suspecting the firewall.

The empty port field is deliberate and worth defending. Every instinct says to prefill 5432 because almost every Postgres service uses it, but Railway's proxy assigns ports per service, so a prefilled 5432 would be confidently wrong. An empty required field asks a question; a wrong default answers it incorrectly and looks settled.

For a cross-source query Railway is ordinary Postgres. A connection you called railway_app is written railway_app.public.orders, and it joins to a folder of CSVs, an on-premises system of record or a billing API in one read-only statement — with nothing copied and nothing scheduled.

Provider reference: docs.railway.com

Built for how Railway works.

DATABASE_PUBLIC_URL, not DATABASE_URL

This is the single most common way a Railway connection fails, and it fails in the least helpful way possible.

  • Railway's private hostname ends in .railway.internal and resolves only inside Railway's own network. From anywhere else it does not resolve at all.
  • The agent runs outside Railway, so the private address is never reachable — the connection would simply hang rather than tell you why.
  • So the card rejects it outright and names the fix: use the public TCP-proxy host from DATABASE_PUBLIC_URL. That turns a silent timeout into a sentence you can act on.
  • The public proxy host ends in .proxy.rlwy.net. Older Railway deploys were issued .railway.app hostnames instead, and those still work if that is what your service has.

The port is per service, so nothing can guess it

Most managed Postgres services answer on 5432. Railway's proxy does not, and the card deliberately leaves the field empty.

  • Railway assigns a proxy port per service. Two databases in the same project will have different ones, and neither will be 5432.
  • The port field has no default for exactly that reason. An assumed 5432 would look filled in and then fail to connect, which is worse than an empty box.
  • Pasting DATABASE_PUBLIC_URL fills the port along with everything else, so the normal path never asks you to find it separately.
  • If you are typing the fields by hand, the port is the one to copy carefully — it is the field most likely to be wrong and the one that produces the least informative failure.

Self-signed certificates, and what encrypted means here

Railway's Postgres image ships a self-signed certificate, which decides how the agent handles TLS.

  • Use SSL is on by default and the connection is encrypted. The agent requires TLS rather than merely offering it.
  • The certificate chain is not verified. Full verification would reject Railway's self-signed certificate, so requiring encryption without validating the chain is the setting that actually matches the service.
  • Read that as protection against anyone reading the traffic on the way, rather than proof of what you reached.
  • There is no pooler in front of Railway Postgres and the card does not pretend otherwise — this is a direct connection over the proxy, with no pooled mode to choose.
-- Ordinary Postgres, read-only, over the public proxy
SELECT   c.name,
         COUNT(o.id)   AS orders,
         SUM(o.amount) AS revenue
FROM     public.customers AS c
JOIN     public.orders    AS o ON o.customer_id = c.id
WHERE    o.placed_at >= now() - interval '30 days'
GROUP BY c.name
ORDER BY revenue DESC;

From connection to useful results.

  1. Install the Network Agent wherever suits you. It opens one outbound connection and never listens, so Railway sees an ordinary client and your network needs no inbound rule.
  2. Open the Postgres service, go to the Variables tab, and copy DATABASE_PUBLIC_URL. That is the public one — DATABASE_URL is the private variable and will not work from outside Railway.
  3. Paste it in. Host, port, database, username and password are read straight out of it.
  4. Check the port came through. Railway assigns a proxy port per service and it is rarely 5432, so this is the field worth glancing at before you save.
  5. Save. Microsoft Excel, Google Sheets, Power BI, MCP and REST all read through that one connection, or join it to your other sources in a single read-only statement.

Put your Railway results to work.

One connection serves your spreadsheets, apps and AI tools. Share permission to run a saved query; recipients see the allowed results, with the SQL and source login hidden.

For your team, vendors and partners

Ask a question in plain English. Nova already knows your Railway tables, writes and runs the SQL, explains the answer and charts it — no query to write, no credentials to hand over.

How Nova works

Share a live Railway result with anyone — a colleague, a vendor, a partner — as a bookmarkable grid that re-runs fresh when opened, on a phone, a tablet or a desktop. They see the results, never the SQL or the credentials.

How the Data Viewer works

For apps and systems

Publish a Railway query as an authenticated JSON endpoint any application can call, with an OpenAPI 3.1 spec and ready-made Postman, Insomnia and Hoppscotch collections. No database port is opened.

PostgreSQL guide

Paste the generated Power Query M into the Power BI Advanced Editor and the report reads live Railway results over HTTPS — no ODBC driver, no database port opened.

Explore Power BI

For AI tools

Delivered to people

Join Railway to the rest of your data.

Bring databases, business APIs, files and logs into one read-only query. Every connector supports Federated Queries.

Name the connections and tables. Query Streams handles the source queries and combines the results.

Explore Federated Queries
Illustrative cross-source query
-- nothing copied, nothing merged, nothing scheduled
SELECT   c.region, COUNT(*) AS orders, SUM(i.amount_due) AS invoiced
FROM     railway_app.public.orders1 f
JOIN     erp_sql.dbo.customers2     c ON c.id = f.customer_id
JOIN     billing.stripe.invoices3   i ON i.customer = c.stripe_id
GROUP BY c.region
ORDER BY invoiced DESC;

Use your own connection, schema, table and column names.

Shared across the connector family.

True of every database connector

  • Outbound only — the agent opens one encrypted connection out to Query Streams. No inbound port to forward, no VPN, no IP allowlist, nothing about your database exposed to the internet.
  • Credentials stay put — the database username and password live on the machine you installed the agent on. Query Streams never receives them and cannot reach your database on its own.
  • Read-only, enforced — one statement at a time, SELECT and friends only. A write is rejected on your own machine before it is ever sent to the server, rather than relying on a permission somebody remembered to set.
  • Deploy as many agents as you like — one per site, region or cloud. Every data source they can see arrives in a single dropdown, so nobody has to know which agent hosts what.

What you get once a query is saved

  • Share the capability, not the SQL — a colleague or an outside partner can run your query and change its filters without ever seeing the statement behind it.
  • Filters from either direction — declare them yourself as @variables, or let the connector spot the literal values already sitting in your WHERE clause and offer those as dropdowns.
  • Read it from anywhere — Microsoft Excel, Google Sheets, Power BI, the REST API, AI assistants over MCP, the Query Builder and Nova all read the same saved query.
  • Run several at once — five saved queries into five worksheet tabs, streamed concurrently, however large the results.
  • Join it to anything else you have connected — another database, a business API, or a folder of files, in one read-only statement.

Questions about Railway

Where can I use Railway query results?

Use Railway results in Excel, Google Sheets, the Data Viewer, your apps through the Database REST API, and AI tools through MCP or Nova. Saved results also feed supported Automation destinations, reports and alerts. Destination availability and allowances depend on your plan.

Do I need to open an inbound port for Railway?

No. Install the Network Agent on a machine that can reach Railway. The agent connects outward to Query Streams; no inbound port or VPN is needed. Your source must still allow the agent machine to connect under its own access rules.

Can Query Streams change data in Railway?

No. Queries are enforced read-only on the Network Agent before execution. Source credentials stay on that machine. Sharing grants permission to run a saved query and receive its results; it does not reveal the SQL or database login.

What do I need to connect Railway?

Host: <name>.proxy.rlwy.net, the public TCP proxy. Older deploys on .railway.app also work. Port: Assigned per service by Railway. No default — it comes from DATABASE_PUBLIC_URL. Driver: Npgsql, carried by the agent — nothing to install at the Railway end. Paste format: DATABASE_PUBLIC_URL from the service Variables tab

Can I join Railway to other connected sources?

Yes. Federated Queries support every connector type, including databases, business APIs, files and logs. Name the connections and tables in one read-only query. Query Streams translates the source portions as needed and combines their results. See how Federated Queries work.

Does Railway use the PostgreSQL connector?

Yes. Railway uses the PostgreSQL wire protocol. Its provider preset supplies the relevant connection settings. The linked PostgreSQL guides apply to the shared workflow; use the provider-specific connection details on this page for your endpoint and security requirements.

Put Railway where the work happens.

Start with Free: every connector type, 2 data sources and 1 Network Agent. Add plan allowances as your needs grow.