How to install pgadmin4 with docker

We want PostgreSQL in a container and pgadmin4 in another container. And we want to connect the pgadmin4 container to the PostgreSQL container.

We do

$ sudo docker run -p 80:80 \
  --link postgres11:postgres11 \
  -e "PGADMIN_DEFAULT_EMAIL=sql.design.company@gmail.com" \
  -e "PGADMIN_DEFAULT_PASSWORD=secret" \
  -d dpage/pgadmin4

Remember that we wrote in the definition of the PostgreSQL container the name of the host :

...
--name postgres11
...

and then we open our browser on 127.0.0.1:80, we give the username/password as defined above and when create a server, we give as host name postgres11

pgadmin4

For the host name, we give postgres11 instead of 127.0.0.1 !

and then…

pgadmin4-running

We can set about tackling the work !