Port forwarding

Local forwarding

Open a service that only your server can reach, such as a database, as if it were running on your Mac.

Example

Your PostgreSQL database runs on db-server and only accepts connections from the server itself. You want to open it in a database app on your Mac.

  1. In Port Forwarding, click New Forwarding and choose Local.
  2. Connect via host: db-server.
  3. Listen on this Mac: 127.0.0.1, port 5433.
  4. Destination: 127.0.0.1, port 5432.
  5. Click Save & Connect.

Now point your database app to localhost:5433.

Good to know

If you’re used to the command line

This does the same as:

ssh -L 5433:127.0.0.1:5432 user@db-server
  • -L means a local tunnel
  • 5433 is the port in Listen on this Mac
  • 127.0.0.1:5432 is the Destination
  • user@db-server is the host in Connect via Host

You don’t need to run this command: Termbit sets everything up for you.