Search code examples
postgresqldockerpgadmin-4

Is it possible to configure server for pgadmin in docker-compose instead of configuring it from pgadmin ui


I am running pgadmin and postgres through docker-compose and both are in same network, so I am able to connect to posgtres from pgadmin after configuring the server in pgadmin. If I do docker-compose down, all containers are destroyed so my server configuration in pgadmin will be lost. If I do docker-compose up again, I will have to configure the server from pgadmin ui again. I want to avoid this manual process of configuring server in pgadmin.


Solution

  • Create a volume and mount the volume in the pgadmin container where config is stored (/etc/pgadmin for Linux). Now your changes will be persisted across restarts.

    https://docs.docker.com/compose/compose-file/compose-file-v3/#volumes