Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GodziLaravel's avatar

how to connect to psql ? psql: FATAL: Peer authentication failed for user "postgres"

Hello

I try to connect to pgsql via ssh :

vagrant@homestead:~$ psql
psql: FATAL:  role "vagrant" does not exist

And as you can see I got this error message :'psql: FATAL: role "vagrant" does not exist'

I use vm-box in windows OS

Thanks

0 likes
1 reply
akosipax's avatar

Either switch the UNIX user to a user existing in postgres—Run `sudo su - [UNIX use in the homestead VM

Or create the vagrant role in postgres. To create the vagrant role, you'd have to use a Postgres SQL client like pgAdmin.

Please or to participate in this conversation.