Install PostgreSQL 14 using Homebrew:
brew install postgresql@14Start the PostgreSQL service:
brew services start postgresql@14Check the version to ensure PostgreSQL is installed correctly:
psql --version
The output should display something like:
psql (PostgreSQL) 14.5
pgAdmin provides a graphical interface to manage your PostgreSQL databases. Install pgAdmin using Homebrew:
brew install --cask pgadmin4Open pgAdmin from your Applications or via Terminal:
open /Applications/pgAdmin\ 4.appCreate a new user named ‘dhis’:
createuser -s dhisSet the password for the user:
psql -c "ALTER USER dhis WITH PASSWORD 'dhis';"Create a new database owned by the user:
createdb -O dhis dhis2Open pgAdmin and navigate to Servers → DHIS2 Database → Databases to see your new database.
This confirms that PostgreSQL 14 and pgAdmin are successfully installed and configured.