docker-compose.yml modified from khezen/compose-postgres.
- Install Docker and Docker-Compose
- Download the
docker volume create pgdataand
docker volume create pgadminto create the volumes
- Open the command-line and navigate to the directory where you have the
docker-compose up -dto start the app
- Go to
localhost:5050with your favourite browser.
- log-in with E-Mail
- On the dashboard, click on
Add New Server
- Give the server any name, and go to the Connection tab. As the hostname, use
postgres, username and role are
postgresas well, and the password is
password. Click on Save to connect to the server.
- Navigate to the database you just created and click on Tools in the navbar and then on Query Tool.
- Now you can use the SQL prompt window!
To stop the application, just enter
docker-compose down in the terminal, when you are in the folder with the
Just follow the steps in the Using chapter to use the app to any later point again. Thanks to the docker volumes, the databases will be persistens even when you shut down Postgres.
If you want to remove the containers, stop the application and use
docker container prune and confirm to remove the containers.
docker images to list all images, and
docker rmi IMAGE_ID where
IMAGE ID is the id of the image (fenglc/pgadmin4) from the list command.
docker volume remove pgdata and
docker volume remove pgadmin to remove the volumes