Guidance on usage: PostgreSQL Server 13 on Linux 7.9

Connecting and configuring PostgreSQL Server 13 on Linux 7.9 using pgAdmin 4 through SSH Tunnel

  1. Before starting, go to the pgAdmin downloading page – Download, select the desired version, download and install it
  1. For the connection to the server, you should know the IP address of the VM. You can find it in the personal account of Azure. Select the virtual machine from the list. By clicking the item “Overview”, your IP is displayed in the line “Public IP Address”.
  1. Run pgAdmin. By default, you will be asked to set master password

Set the password and click “OK”.

  1. Click on “Add New Server” on the main page
  1. In the appeared pop-up window in the “Name” field, enter the name of your connection 
  1. Go to the “Connection” tab and in the “Host name/address” field type
  1. Enter “postgres” in the “Username” and “Password” fields.
  1. Go to the “SSH Tunnel” tab and click the “Use SSH tunneling” switch (1), in the “Tunnel host” field enter the address of the virtual machine (2), in the “Username” field type the username to connect to VM (3), in the “Password” field enter the password (4), which you have used at connecting to the virtual machine. Click on “Save” (5) to confirm the changes and establish the connection
  1. Your connection is ready
  1. To manage with the PostgreSQL server manually, you should connect to a VM. 
  2. With OpenSSH

In the Windows 10 operating system (starting with version 1809 ), an OpenSSH client is available, with which you can connect to Linux servers via SSH. If Windows 10 is suitable and the OpenSSH client is installed, you can start connecting via SSH. To do this, launch a normal Windows command prompt and enter the command “ssh user@*vm_ip*” (1), where “user” is the username that was specified while creating the virtual machine and “*vm_ip*” is the VM IP address.

Then type “Yes” (2) and enter a password (3) that was specified while creating the virtual machine.

  1. With the PuTTy application 

Run Putty, enter the VM address in the “Host” field (1), and click “Open” (2) to connect.

In the opened console, you will need to enter a username (1) and password (2) that were specified while the VM was being created (you’ll not see the password in the console while entering it). 

  1. To check the server version enter

$ psql -V

More information – 13: PostgreSQL 13.9 Documentation