Running pgAdmin 4 in Docker
Pulling the official pgAdmin 4 image and starting it in a Docker container with its login variables.
pgAdmin 4 can run in a Docker container from the official dpage/pgadmin4 image.
Pull the image
docker pull dpage/pgadmin4
Start the container
docker run -p <host_port>:80 -e 'PGADMIN_DEFAULT_EMAIL=admin@example.com' -e 'PGADMIN_DEFAULT_PASSWORD=<password>' -d dpage/pgadmin4
-p <host_port>:80publishes port 80 of the container on a port of your choice on the host.-esets the login e-mail and the password of the pgAdmin web interface.-druns the container in the background.
Open http://localhost:<host_port> in a browser and sign in with the e-mail and password set above.
Notes
- The host port is not given in the original note: choose any free port.
- The password stays in the shell history. Use a test password, or remove the line from the history.