I experienced that installing your Postgres database server on your local machine as a Docker container is not that evident. So this explains how you need to do it and what you need to take into account.
To setup your Postgres Docker container you need to run:
docker run -d -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword --name postgres-server -p 5432:5432 -v pgdata:/var/lib/postgresql/data --restart=always postgres
And to run your pgadmin instance as a Docker container: