Installing PostgreSQL on MacOS
Tags: postgres, installpostgres, postgresmac
Published: 2021-08-31 08:49:19

---
title: Installing PostgreSQL on MacOS
published: true
date: 2021-08-31 12:00:00 UTC
tags: postgresql, installpostgres, postgresmac
canonical_url: https://postsrc.com/posts/installing-postgresql-on-macos
---
[This post was originally published at PostSrc 🔥🔥🔥](https://postsrc.com/). If you like this kind of tutorial, I would really appreciate it if you give it a visit.

![Installing PostgreSQL on MacOS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wqzl89rphw3p3gl6k04.jpg)

There are several ways to install PostgreSQL on macOS and in this tutorial, you'll learn the easy way.    
  
**Installing PostgreSQL via DBngin**  
The first way is to install it using [DBngin](https://dbngin.com/) and it's a free all-in-one database version management tool that comes with other databases as well such as MySQL and Redis. Under the hood, it's using [Homebrew](https://brew.sh/) and the setup process is very simple. DBngin comes with a very simple GUI and anything from creating, starting, and stopping the database server can be done with a simple one-click button.

[![DBngin Interface](https://postsrc.com/storage/TSPeD30BU1Aca7lsqs9M8pN56pdc63f4fBFgHjJR.png)<figcaption>DBngin Interface</figcaption>](https://postsrc.com/storage/TSPeD30BU1Aca7lsqs9M8pN56pdc63f4fBFgHjJR.png)

To create a new database simply press the + button and fill in the details required.

[![DBngin Create new Database](https://postsrc.com/storage/veZHoSnAPnhdbuC6HjRTV41JK9Svoi57pytPdgYw.png)<figcaption>DBngin Create new Database</figcaption>](https://postsrc.com/storage/veZHoSnAPnhdbuC6HjRTV41JK9Svoi57pytPdgYw.png)

  
What makes it special is the simple interface, simple database versioning, one press starting and stopping server and future updates right in one app.   
  
**Installing PostgreSQL via Homebrew** The second method is to use the [Homebrew](https://brew.sh/) package manager. Let's get started and first launch your terminal and run the command below one by one.  
  
Update brew to get the latest package version from the source.

```
brew update
```

  
Run brew doctor to run diagnosis to check if there are any errors.

```
brew doctor
```

  
Install the latest version of PostgreSQL.

```
brew install postgresql
```

  
Starting the PostgreSQL server.

```
brew services start postgresql
```

  
If you want to stop then run the stop command.

```
brew services stop postgresql
```

  
Lastly, to view any running services run the services command.

```
brew services list
```

  
Do note that the command above installs the latest version of the database, if you want other versions you have to specify the version number. For example, if you want to install version 12 run the command like below.

```
brew install postgresql@12 
```

  
**Installing PostgreSQL via Postgres.app**  
The 3rd method is to use [Postgres.app](https://postgresapp.com/) and this application works just like DBngin but only has PostgreSQL database. It comes with a simple user interface and you can start, stop, restart, update and perform other actions with a click of a button. Do give it a look and if you are interested to try, just visit the homepage since it provides very straightforward installation guides.   
  
**Installing PostgreSQL via Package Installer**  
The last method is to install it using the [official package installer](https://www.postgresql.org/download/) from PostgreSQL page. To get started just follow along with the installation wizard and you will have it installed in no time. It also comes with _pgAdmin_ which is a database management tool that is quite handy to use.   

[![Official PostgreSQL download page](https://postsrc.com/storage/bJTLBnZBqDWl2YcPEBlg5m7rF9thdVYIS9ajBNAj.png)<figcaption>Official PostgreSQL download page</figcaption>](https://postsrc.com/storage/bJTLBnZBqDWl2YcPEBlg5m7rF9thdVYIS9ajBNAj.png)

  
By now you should have PostgreSQL installed on your macOS and if you come across any issue do start a new discussion below. Thanks for reading and if you find it helpful do share it with your friends.