How to install, run postgres server on Apple Mac OS (2021 tutorial)

1. install postgres server via Homebrew

brew install postgres

2. start postgres server

brew services start postgres
brew services stop postgres
brew services restart postgres

3. Create user or a database

createuser myuser -P (this will ask for a password twice)
createdb mydatabase -O myuser (this will assign previously created user as an owner for the database and them permissions)

Sources:

Credits:

Leave a comment

Your email address will not be published. Required fields are marked *