Install Postgres and psql on Mac

Published: Oct 11, 2019
Updated: Feb 28, 2022

For your local database needs.

  1. Download and install Postgres.app

  2. Set environment variables in your shell config file

     export POSTGRES_HOME=/Applications/Postgres.app/Contents/Versions/latest
     export PATH=${POSTGRES_HOME}/bin:${PATH}
    
  3. Restart Terminal

  4. Confirm installation

     psql --version