This problem /var/run/postgresql/.s.PGSQL.5432 is about permission,
did you change the database directory? if yes, so you need to give write and read permission to the postgres
sudo chown -R postgres:postgres <directory_path>
or
sudo chmod -R 777 <directory_path>
case you cannot use remote access, on pg_config edit this line listen_addresses = 'localhost' to listen_addresses = '*'
and in the pg_hba.conf insert this line:
host all all 0.0.0.0/0 md5