Setup Postgres On Your Mac in 10 Min

Manav Garg @sigmapie8
3 min readMar 21, 2023

I wrote this tutorial for setting up the local environment for Udacity’s DataScience Nanodegree program but it works for anybody trying to setup a postgres server on Mac.

Machine Used: Macbook Pro M1

Download & Install Postgres

Although there are four different ways mentioned in the download doc, I find the postgress.app to be the easiest. Please install the it from here — https://postgresapp.com/downloads.html

After you have installed the app, your window should look something like this:

Let’s spin a new server for our self.

  1. Stop the existing server.
  2. Hit the plus button on the bottom left and fill in the details. Remember that you require an empty folder for creating the server,
  3. Press initialize .
  4. You should have a new server running. Now tap on any of the databases and it should open the terminal.

Version Check: select version();

Download the Database

Download the database from here. Double click the .zip file to unzip it.

Download PGAdmin

Now that we have the database and the data, let’s have a nice interface that we can use to interact with the database. PGAdmin would help us with that. Please download the latest release from here.

Post installation, you should have something like this:

Let’s connect our server from pgAdmin. Click on Add New Server .

  • Name: Name of the server you just started
  • Connection -> Host name: localhost

Save and you’ll be able to see your server info:

Loading Data in the Database

  1. Create a blank database, with the name dvdrental.

2. Restore the data from the locally downloaded database.

3. Give the path to unzipped directory

4. Open the Query tool by right clicking the dvdrental in the left pane and selecting Query Tool

5. Run a the query — select * from actor;

You can find all your tables at — dvdrental -> Schemas -> public -> Tables.

Clap if it helps you.

--

--