Skip to content

Instantly share code, notes, and snippets.

@abranhe
Last active June 13, 2020 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abranhe/1251704d9536bd437a253d2a46793d78 to your computer and use it in GitHub Desktop.
Save abranhe/1251704d9536bd437a253d2a46793d78 to your computer and use it in GitHub Desktop.
Running pgAdmin with Postgres on Docker - Play with docker

Go to Play with docker and login. Once logged in:

Download pgAdmin

docker pull dpage/pgadmin4

Start the pgAdmin server

docker run -p 8089:80 \
 -e 'PGADMIN_DEFAULT_EMAIL=admin@admin.com' \
 -e 'PGADMIN_DEFAULT_PASSWORD=pass' \
 -d dpage/pgadmin4

Download

docker pull postgres

Run the postgress db

docker run --name db -e POSTGRES_PASSWORD=pass -d postgres

Get container IP address:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' db

Login to pgAdmin with admin@admin.com and pass you set up ealier. Once inside add new Server create new server and add the IP address as host, your username (postgres) and password (pass).

That's it! Enjoy 😁

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