PostgreSQL
PostgreSQL is a popular relational database used in many modern applications. This guide provides the basic steps to tunnel a connection through Pomerium to a Postgres instance.
Basic Connection
- Create a TCP tunnel, using either
pomerium-cli
or the Pomerium Desktop client:
- pomerium-cli
- Pomerium Desktop
$ pomerium-cli tcp pgsql.localhost.pomerium.io:5432 --listen localhost:5432
Local Address
The Local Address field is optional. Using it defines what port the tunnel listens on locally. If not specified, Pomerium Desktop will choose a random available port.
- Initiate your Postgres connection, pointing to
localhost
:
$ psql -h localhost -W -U postgres -c '\dn'