postgres – with docker

PGADMIN

Pull the image:

docker pull dpage/pgadmin4

Run the image with:

docker run -p 5050:80 -e "PGADMIN_DEFAULT_EMAIL=myemail@gmail.com" -e "PGADMIN_DEFAULT_PASSWORD=a1234
5678" -d dpage/pgadmin4

Open browser at post 5050:

http://localhost:5050

Client (psql)

Use the flags:

  • it: interactive with terminal
  • rm: remove container afterwards
  • v: to allow access to a directory of the host (optional)
docker run -v external_dir:docker_dir -it --rm server_name psql -h host_name -U username -d database_name

You may have to set-up SSL or disable “require SSL connection” from server.

Personal portal to the Internet