Run PostgreSQL with Docker

docker run --name local-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=devdb \
  -p 5432:5432 \
  -d postgres
  • Connect with:
    Host: localhost
    Port: 5432
    User: postgres
    Password: postgres
    DB: devdb

Check the connection with

psql -h localhost -U postgres -d devdb