Expose a local database (Postgres, Redis) over a public TCP tunnel
Florian Wartner · 2026-06-24
To expose a local database over the internet, use a raw TCP tunnel that forwards a public port to your local service - not an HTTP tunnel. Databases speak their own binary protocols (Postgres, Redis, MySQL) rather than HTTP, so they need a transport-level tunnel that passes bytes through untouched.
npx useburrow tcp 5432
That forwards a public TCP endpoint to your local Postgres on port 5432, so a teammate or a cloud service can connect to it with a normal database client.
When you need raw TCP instead of HTTP
HTTP tunnels are for web servers and webhooks - request/response over HTTP. They do not work for protocols that are not HTTP. A TCP tunnel forwards the raw byte stream, which is what you want for:
- Sharing a dev Postgres or MySQL. Let a colleague connect a
psqlor GUI client to the database running on your laptop, without them setting up their own copy and seed data. - Exposing a Redis instance. Point another service at your local Redis to reproduce a caching or queue issue against the exact data you have locally.
- Reaching a local service from the cloud. A hosted CI job, a webhook-driven worker, or a SaaS integration needs to open a connection to your machine - for example a managed platform that wants to read from a local database during a migration test.
- Tunneling SSH. Forward port 22 so you can reach a machine that is otherwise behind NAT.
If the thing you are exposing speaks HTTP, use an HTTP tunnel instead - you get the local request inspector and webhook tooling. If it speaks anything else, TCP is the answer.
The dedicated public port model
An HTTP tunnel gives you a hostname. A TCP tunnel gives you a host and a dedicated public port, because that is what a database client connects to. When you run the command, Burrow assigns a public endpoint and prints it:
npx useburrow tcp 5432
# Public TCP endpoint: tcp.eu.useburrow.dev:<assigned-port>
Your teammate then connects exactly as they would to any remote database, pointing their client at that host and port:
psql "host=tcp.eu.useburrow.dev port=<assigned-port> user=app dbname=app"
The connection lands on your local 5432. The protocol is untouched end to end, so TLS negotiated by Postgres, Redis AUTH, and everything else behave as if the client were on your network. See features for the full list of tunnel types.
Security: a public database port is a real exposure
This is the part to slow down on. A TCP tunnel to a database is a public door to your data. Treat it that way:
- Always require credentials. Never expose a database with auth disabled or with default/empty passwords. The tunnel does not add a password; your database's own auth is the gate. For Redis specifically, make sure
requirepass(or ACLs) is set before you tunnel it - an unauthenticated Redis is a classic mistake. - Prefer short-lived tunnels. Open the tunnel when you need it, close it when you are done. A database port that is up for a five-minute demo is a much smaller target than one left running overnight.
- Lock it down at the edge. Use IP allowlists so only your teammate's address or a known cloud egress range can connect. The edge refuses everyone else before the connection reaches your machine. If your collaborators are all in the EU, the "EU-only access" policy cuts the rest of the internet's scanners off entirely.
- Use a throwaway or read-scoped account. Connect clients with a database user that has only the privileges the task needs, not your superuser.
- Do not expose production data casually. A dev database with synthetic data is a fine thing to share. A copy of real customer data behind a public port is not - and if it contains personal data, that exposure is a DSGVO concern, not just an ops one.
The combination that works well in practice: credentials on the database, an IP allowlist at the edge, and a tunnel you close as soon as the task is done.
EU-hosted, same as everything else
TCP tunnels run on the same EU infrastructure as the rest of Burrow - the edge that accepts the public connection is hosted in the EU (Hetzner Germany and Finland). The byte stream is forwarded, not stored. There is no request body persistence to think about, because a raw TCP tunnel does not parse or keep your traffic; it relays it.
FAQ
Can I expose Postgres or MySQL with a tunnel?
Yes. Use a TCP tunnel: npx useburrow tcp 5432 for Postgres or npx useburrow tcp 3306 for MySQL. Clients connect to the assigned public host and port.
Why not just use an HTTP tunnel? HTTP tunnels only carry HTTP. Databases speak their own binary protocols, so they need a raw TCP tunnel that forwards bytes without interpreting them.
Is it safe to expose a database this way? Only if you do it carefully: keep credentials on, restrict access with an IP allowlist at the edge, use a least-privilege account, and close the tunnel when you are done. A public database port is a real exposure.
Can I restrict who connects? Yes. The edge supports IP allowlists and geo policies, including an "EU-only access" toggle, so you can limit connections to known addresses or regions.
Does Burrow store my database traffic? No. A TCP tunnel relays the raw byte stream; it does not parse or persist it. See pricing for which plans include TCP tunnels.