Skip to content

Instantly share code, notes, and snippets.

View yarox's full-sized avatar

Adrian Martin yarox

  • The Wonder Lab
  • Paradise
View GitHub Profile
@yarox
yarox / setup-postgresql-vagrant.md
Last active March 2, 2018 17:33 — forked from carymrobbins/setup-postgresql-vagrant.md
Configure PostgreSQL in a Vagrant guest to allow connections from the host.

Configure PostgreSQL

  • Add host all all 0.0.0.0/0 trust to /etc/postgresql/<version>/main/pg_hba.conf
  • Update /etc/postgresql/<version>/main/postgresql.conf to use listen_addresses = '*'
  • Restart the server with sudo /etc/init.d/postgresql restart

Configure Vagrant

  • Add config.vm.network :forwarded_port, host: 5432, guest: 5432 to the Vagrant.configure block in your Vagrantfile.

Test your connection