Use an SSH tunnel

If your Postgres instance is not accessible to the public, you can connect to it using an SSH tunnel

Prerequisites

  • The SSH tunnel host must be on the same network as your Postgres host.

Connecting using a tunnel

  1. Enter the hostname, port, and username of the ssh tunnel you would like to use.

  2. Copy the provided Public Key into the authorized_keys file in your SSH config for the username you provided.

    • Note: the provided Public Key is generated during setup, and is unique to every connection.

    • This means that if you have multiple SSH tunnels, you will have multiple public keys in your authorized_keys

Last updated