DEV Community

Discussion on: Installing pgAdmin Only after installing PostgreSQL with Homebrew Part 2

Collapse
 
bgadrian profile image
Adrian B.G.

Or ... you can install the DB and the admin using docker.

I have not tested these commands, but I just want to give an example how easy it is. I apply the same technique for mysql, mongoDB and postgres, around 10 bash commands to install/update all of them, and their admins, and it works on any OS (I use more of them).

#https://hub.docker.com/_/postgres/
#create a permanent volume, so the data will not be lost when you do docker rm postgres
docker volume create pgdata

#download, "install", and run the DB inside a container
docker run --name postgres -e POSTGRES_PASSWORD=root -v pgdata:/var/lib/postgresql/data -d postgres

#download, "install", and run the pgadmin 
docker run --name postgresadmin -p 8082:5050 --link postgres:postgres -d fenglc/pgadmin4

I use docker for my dev setup for a few years and it is a great experience, I can switch between technology stacks without polluting my system, or care about what OS I'm on now, unlike homebrew, apt-get or chocolatey, docker commands run are the same.
I don't need to handle different versions of languages, libs, compilation errors, dependencies, and so on.

Collapse
 
letsbsocial1 profile image
Maria Campbell

Maybe I will look into it sometime when the need is there. Have heard good things about it. Thanks for sharing!