DEV Community

Discussion on: How To Install and Run PostgreSQL using Docker ?

lawrenceonen profile image
Onen Lawrence Lakuma

The reason you have to create a volume (which is mapped to your container) is to locally persist your data so that in the event you stop/restart your container, you can always have your data. So, your database stays though you will need the container running in order to access it.