You can easily run postgreSQL and pgAdmin UI interface on windows WSL as docker containers. You can install WSL on windows using this link.
PostgreSQL DB in Container
You can now run Postgres in docker container with simple command which will create a container and expose the port used by Postgres so it can be accessed from the host.
here 2 containers will be started, one for dev (postgres-dev) setup and one for test (postgres-test) setup. The containers will show up like below
pgAdmin UI Interface in Container
Now to connect to these databases, we will run pgAdmin UI interface in container using the below command-
here pgAdmin container exposes on port 8080. Once ui interface is started, it will have a container running as shown
Now we can access pgAdmin UI interface. Open browser and type localhost:8080
It will connect to pgAdmin and show this page with successful login-
Now you can add connection to DEV and TEST postgres DB.
You are now connected to both DEV and TEST postgreSQL databases which are running in container.
You can stop and start these containers as and when required.
Persist PostgreSQL DB
In case you want to remove the container to start new version of postgreSQL and still want to have all the users, databases and other objects then use data volume container to achieve this. Using the below command start the data volume container
Now you can start the postgres database container by attaching this volume container to it. This way even if the postgres container is removed, the data container will be available to attach to new postgres server container-