Skip to content

Instantly share code, notes, and snippets.

@venkatd
Last active February 10, 2021 19:44
Show Gist options
  • Save venkatd/236470bcb4bc4eab435ec72f20de5c5a to your computer and use it in GitHub Desktop.
Save venkatd/236470bcb4bc4eab435ec72f20de5c5a to your computer and use it in GitHub Desktop.

Setting up pghero

Install docker for Mac

https://www.docker.com/docker-mac

Install pghero

Run the following commands

localip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\  -f2)
dburl=postgres://venkat@docker.local:5432/turtle_dev
docker rm hero
docker run -ti -e DATABASE_URL=$dburl --add-host=docker.local:$localip -p 8080:8080 --name hero ankane/pghero

Allow access to local postgres installation

Edit the configuration file in postgres to allow all ips

  1. listen_addresses = '*' in the postgresql.conf file. Make sure to uncomment it.
  2. Make sure you have the following entry in pg_hba.conf:
# TYPE  DATABASE        USER            ADDRESS                 METHOD
host  all  all 0.0.0.0/0 trust
  1. Restart server

View in the browser

open http://localhost:8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment