Run PostgreSQL in Docker

To run PostgreSQL on docker, create a directory for saving the data presistant

run docker container

In above, change the value for POSTGRES_DB, POSTGRES_USER and POSTGRES_PASSWORD as needed.

Connect to PostgreSQL server

To connect to PostgreSQL server, run

Now you are inside PostgreSQL conainer, to login, run

It will ask for password. Once you enter password, you will be in PostgreSQL command line.

See docker

Add a Comment

Your email address will not be published. Required fields are marked *