How to update the Pgadmin4
docker image without losing any the user's information in the folder/var/lib/pgadmin
?

- 8,280
- 11
- 53
- 103
3 Answers
Pull the latest docker image
sudo docker pull dpage/pgadmin4
Stop the running container
sudo docker stop pgadmin
Remove existing container
sudo docker rm pgadmin
Deploy/Run the latest images
sudo docker run --name pgadmin -p 80:80 -v /var/lib/pgadmin:/var/lib/pgadmin -e 'PGADMIN_DEFAULT_EMAIL=m.thirumal@hotmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=thirumal' -d dpage/pgadmin4
or the below command for reverse proxy with
ngnix
sudo docker run --name pgadmin -p 5050:80 -v /var/lib/pgadmin:/var/lib/pgadmin -e 'PGADMIN_DEFAULT_EMAIL=m.thirumal@hotmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=thirumal' -d dpage/pgadmin4
To start
the docker container
`sudo docker start pgadmin`
For more information, refer: https://m-thirumal.github.io/installation_guide/#/pgadmin4/update_pgadmin4_docker_image

- 8,280
- 11
- 53
- 103
The choosen answer is correct, but if you doesn't have any volume for your starting image yet you also have to do:
sudo docker cp name_of_your_image:/var/lib/pgadmin /var/lib/pgadmin
and
sudo chown -R 5050:5050 /var/lib/pgadmin

- 63
- 1
- 6
I use a docker named volume to permanently store the /var/lib/pgadmin
folder.
Updating pgadmin's version then just requires changing the image name in my docker-compose.yml.
version: '3.7'
services:
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:7.3
restart: always
env_file:
- ../pgadmin.env
volumes:
- my-pgadmin-volume:/var/lib/pgadmin
ports:
- 5050:80

- 11
- 3