Skip to content

Connect to private databases without a public IP

Reach PostgreSQL, MySQL, and SQL Server inside your own or your customers’ intranets with your database client. No VPN, public IP, or router port forwarding required.

You need Node.js 26.7 or later and a Tubu API key on the publisher machine. Follow the Quick start to get your key. Replace YOUR_API_KEY and choose an available Tubu domain in the examples. The publisher must reach the target service and connect outward to Tubu. Keep it running while access is needed.

Your database has a private address

Your database client cannot reach a server inside another company’s LAN. Tubu connects a TCP database through a publisher inside that network and a local listener on your computer. Install Node.js 26.7 or later on both machines. Keep database authentication and TLS configured for your environment.

Connect to PostgreSQL

On a machine inside the database network:

npx tubu-cli tcp tcp://192.168.1.40:5432 --domain customer-pg.tubu.dev --authtoken YOUR_API_KEY

After Tunnel ready, run this on your computer and wait for Listening:

npx tubu-cli forward 15432 --domain customer-pg.tubu.dev

In another terminal, connect with your database credentials:

psql -h 127.0.0.1 -p 15432 -U app -d appdb

Connect to MySQL

On the publisher inside the customer network:

npx tubu-cli tcp tcp://192.168.1.41:3306 --domain customer-mysql.tubu.dev --authtoken YOUR_API_KEY

On your computer, start the listener, then run MySQL in a separate terminal:

npx tubu-cli forward 13306 --domain customer-mysql.tubu.dev
mysql --protocol=TCP -h 127.0.0.1 -P 13306 -u app -p

Connect to SQL Server over TCP

Enable TCP on the target instance and use its configured fixed port. This example uses 1433. Named instance discovery over UDP is not transported.

npx tubu-cli tcp tcp://192.168.1.42:1433 --domain customer-sql.tubu.dev --authtoken YOUR_API_KEY

On your computer:

npx tubu-cli forward 11433 --domain customer-sql.tubu.dev

In another terminal, use SQL authentication for this example:

sqlcmd -S tcp:127.0.0.1,11433 -U app -d appdb -Q "SELECT 1"

Enter your password when prompted. Configure your client’s trusted certificate and expected database hostname for TLS. SQL Server compatibility depends on your instance, client, and authentication setup; validate these together before relying on the connection.

Verify the connection with your usual client

SELECT 1;

Expect a result containing 1. GUI clients can use the same local host and listener port. Tubu transports database TLS unchanged; preserve the expected certificate hostname rather than disabling validation.

Callers do not need a Tubu API key. The database must authenticate them. Keep the publisher and listener running. If the connection fails, check the listener, the publisher’s access to the database, credentials, and TLS settings. Stop both Tubu processes with Ctrl+C when finished.

Get started with Tubu