Posts Learn Components new Snippets new Categories Tags About Device Beast sponsor

How to Install PostgreSQL 13 in MacOS Big Sur via Homebrew

Learn how to install PostgreSQL 13 in macOS big sur by using homebrew in few simple steps

4 months ago

5 mins read


In this post, you'll be learning how to install PostgreSQL 13 in macOS through the command line with the help of Homebrew package manager. The steps are very simple so do follow along and let's get started.

Install Homebrew

Launch your terminal and type in the command below to install Homebrew. Do note that it works for both Intel MacBook and ARM-based MacBook so you don't have to worry about incompatibility.
/bin/bash -c "$(curl -fsSL" 
Next, do update the brew to get the latest package version from the source.
brew update
If necessary, also run brew doctor to run diagnosis to check if there are any errors.
brew doctor

Install PostgreSQL

To install PostgreSQL version 13 (the latest version at the time of writing) run the command below. Do note that each new version released will still be named "postgresql".
brew install postgresql
If for some reason you prefer to install PostgreSQL version 11 or 12 do specify the version by appending the version number at the end.
brew install [email protected]
brew install [email protected]

To start the PostgreSQL server, run the brew services command like below.
brew services start postgresql
If you want to stop it then run the stop command.
brew services stop postgresql
Lastly, to view any running services run the services command.
brew services list

Integrate with Laravel

If you are developing a Laravel web application and you want to make use of PostgreSQL, do change the environment configuration like below. The connection should be "pgsql", the port number is 5432, the username is "postgres" and the password is empty.
If you find this tutorial to be helpful do share it with others and cheers! 🍻

PostSrc Code Snippets

Learn new snippets today, level up your Laravel, Alpine JS, Vue JS, Tailwind CSS skills and more.

Learn New Snippets

Authored by

PostSrc poster


Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.


PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components