I am using PgAdmin4 3.3, and I am trying to setup a server connection to a database through an SSH tunnel.

My database runs on port 30000 on the host. Setting it to 5432 is unfortunately not possible.

When I tunnel that port manually in the terminal it works perfectly: ssh -L 30000: user@host

My server configuration is then to connect to localhost on port 30000.

If I now disconnect the ssh session and try to configure it directly in the pgAdmin UI, it wont work.

pgAdmin4 SSH Tunnel Tab

After I save the config and try to connect to the database it takes about a minute and then I get a connection lost message.

Thanks in advance!