You can get PGAdmin 4 running in server mode with docker very easily. Using this command will set up the server, set it to always restart in response to reboots or errors, and it will ensure that its data (users, config) is persisted between container runs.
docker pull dpage/pgadmin4 docker run -p 80:80 \ --name pgadmin \ --restart always \ -v "/opt/pgadmin4/data:/var/lib/pgadmin" \ -v "/opt/pgadmin4/config/servers.json:/servers.json" \ -e "PGADMIN_DEFAULT_EMAIL=user@domain.com" \ -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \ -d dpage/pgadmin4
You can run this command afterward to see the details and confirm the restart policy as well if you like:
docker inspect pgadmin