In this article, we'll set up PostgreSQL the easy way -- using EnterpriseDb installer suggested by the postgres website.
You don't need lots of space on your machine.
It's not hard to do.
This is for local setup only.
2. Setup Overview
PostgreSQL is my personal favorite for local machine access. It has such a nice installer.
2.1 Get the Installer
If you're not using mac, go to www.postgresql.org/download to find the appropriate installer for your machine. I'll just go over the installation for mac.
Based on the postgresql.org advice, I am going to www.enterprisedb.com/products/pgdownload.do#macosx. I am choosing the latest version. For me at the time of this writing, that is 10. You should use whichever version will be used on your production servers.
I'm also choosing the right Operating System, which for me is Mac OS X.
Now, all I am doing is clicking Download Now.
Be sure you know where your downloads are going from your browser. They can go literally anywhere. I don't know how your computer is set up.
You will be prompted to save a dmg. This is a disk image. It is your installer. You will have to run it once it is downloaded. So click Save File in the "Opening postgresql-10.0.-1-OSX.dmg" window that pops up.
2.2 Initiate the Installer Wizard
Check your downloads for something like postgresql-10.0-1-OSX.dmg. Click or double-click the file, as the case may be. It loads the disk image and launches a new window.
Remember, this is a disk image so it needs to be unmounted when you're done. We'll talk about that later.
In the new window that opened when you loaded the disk image, double click the postgresql-10.0-1-OSX icon. This begins the installer. You might be presented with a warning about opening the application because it is downloaded from the internet.
It is ok to click open. You will need to enter your login password next to allow PostgreSQL to be installed.
The setup Wizard begins. It's very straightforward.
2.3 Complete the Installation Wizard
Installation Directory: Use the default location for the PostgreSQL installation
Select Components: Deselect Stack Builder if you don't think you need it
Data Directory: Use the default location for the data directory
Password: Think up a password you can remember if this is just test data.
Port: Use the default port, 5433. Do not change this on your local machine unless you have 2 postgres instances running at once for some reason.
Advanced Options: use the default locale.
Click Next a few times
If you do not need to connect to this postgres instance remotely, click deny when the window pops up asking you to open up your firewall. You can always change this later in the Firewall pane of Security & Privacy preferences. It's probably a good idea to click deny.
Finish the Wizard
2.4 Eject the Disk Image
There are two ways to do this:
Find the icon for the postgresql dmg on the Desktop. Two-finger click and select "Eject".
Open up the Finder. Click the triangle eject button next to "PostgreSQL 10.0-1"
Now you have a Local Postgres Instance.
Voilà. Esso ecco. Now you have Postgres installed on your machine.