Skip to content

Instantly share code, notes, and snippets.

@ArtoCully
Last active December 13, 2021 15:17
Show Gist options
  • Save ArtoCully/e5114791c62ec37979e82de0a9b72452 to your computer and use it in GitHub Desktop.
Save ArtoCully/e5114791c62ec37979e82de0a9b72452 to your computer and use it in GitHub Desktop.
Docker Postgres Local Setup

Steps to setup local docker postgres

  1. Create a directory to store postgres data
mkdir -p ${HOME}/postgres-data/
  1. Run postgres image
docker run -d \
--name dev-postgres
-e POSTGRES_PASSWORD=Pass2020!
-v ${HOME}/postgres-data/:/var/lib/postgresql/data \
-p 5432:5432
postgres
  1. Check that the container is running
docker ps
  1. Run instance of PostgreSQL
docker exec -it dev-postgres bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment