Skip to content

Instantly share code, notes, and snippets.

@dannyfritz
Last active October 10, 2017 17:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save dannyfritz/5a267f47e8887904cb220c156c97807c to your computer and use it in GitHub Desktop.
Save dannyfritz/5a267f47e8887904cb220c156c97807c to your computer and use it in GitHub Desktop.

How to install Postgres

Directions

Install Postgres:

$ brew install postgresql

Install Homebrew Services:

$ brew tap homebrew/services

Start Postgres as a service:

$ brew services start postgres

Bootstrap a database:

$ createdb

Verify that Postgres is running:

$ psql

If it worked, you'll see something like this:

psql (9.5.3)
Type "help" for help.

dannyfritz=#

Quit out of psql with \q:

psql (9.5.3)
Type "help" for help.

dannyfritz=# \q
$

Finished! 🎉

Congratulations! Now Postgres will start automatically on login!

Bonus

See a list of all services running with:

$ brew services list

Stop Postgres from running with:

$ brew services stop postgres
@N8BAUER
Copy link

N8BAUER commented Sep 5, 2017

Well comprised; easy to use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment