Connect to a local PostgreSQL server using peer auth with pgAdmin
Make sure you have the OS user, which you have used to launch PGAdmin3 or PGAdmin4, is in the database.
For creating an OS user in the database, you can use following command:

sudo -u postgres psql -c "CREATE USER $(id -nu;" postgres


In HOST name address include the Postgres unix_socket_directories
You can use following command to get the unix_socket_directories setting

sudo -u postgres psql -c "SHOW unix_socket_directories;"