Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
docker postgres

run postgres in docker

docker run -it --rm --name pg -e POSTGRES_PASSWORD=pgp -e POSTGRES_USER=pgu -e POSTGRES_DB=pgdb -p 5432:5432 postgres

connect to postgres from psql:

PGPASSWORD=pgp psql --dbname pgdb --host=localhost --username=pgu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment