<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lorena Dávila Ermus</title>
    <description>The latest articles on DEV Community by Lorena Dávila Ermus (@lorena_dvila_5ab5ef35ec6).</description>
    <link>https://dev.to/lorena_dvila_5ab5ef35ec6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2889441%2F3e6e2ead-6203-45fa-b2f3-926a0eb4d1a9.png</url>
      <title>DEV Community: Lorena Dávila Ermus</title>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lorena_dvila_5ab5ef35ec6"/>
    <language>en</language>
    <item>
      <title>1. Quick Guide to Setting Up PostgreSQL on Mac via CLI with Homebrew</title>
      <dc:creator>Lorena Dávila Ermus</dc:creator>
      <pubDate>Thu, 14 May 2026 21:34:45 +0000</pubDate>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6/1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548</link>
      <guid>https://dev.to/lorena_dvila_5ab5ef35ec6/1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548</guid>
      <description>&lt;p&gt;Hey, I'm excited to do a series of short articles to set up Free AI tools such as n8n and Ollama on your local machine, or to setup the environment for your personal projects.&lt;/p&gt;

&lt;p&gt;One of the first issues you may encounter is that you may not have postgres running on local.&lt;/p&gt;

&lt;p&gt;To solve that with the minimal setup follow these exact steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install and Start the Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open your Mac Terminal and run these commands to install Postgres and keep it running in the background&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew install postgresql    # Installs the latest version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services start postgresql    # Keeps it running in the background&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(Optional) You can check if it is running or stop it later using these commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services list&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services stop postgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Connect for the First Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Homebrew automatically creates a default superuser matching your Mac username with a blank password. You do not need a password yet. &lt;em&gt;Connect directly to the default &lt;code&gt;postgres&lt;/code&gt; template database&lt;/em&gt; by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;psql -U $(whoami) -d postgres&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your terminal prompt will change to &lt;code&gt;postgres=#&lt;/code&gt;. You are now inside the database engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Useful Navigation Shortcuts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the Postgres prompt, use these quick slash commands to inspect your setup:&lt;br&gt;
&lt;code&gt;\du&lt;/code&gt; -&amp;gt; View all database users.&lt;br&gt;
&lt;code&gt;\l&lt;/code&gt; -&amp;gt; View all existing databases (including the default postgres).&lt;br&gt;
&lt;code&gt;\q&lt;/code&gt; -&amp;gt; Exit Postgres and return to your regular terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create Your Project Database and User&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is best practice not to use your superuser account for applications. Instead, run these SQL commands inside the prompt to set up a clean environment. Remember the semicolons at the end of each line:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE USER my_project_user WITH PASSWORD 'my_secure_password';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE DATABASE my_project_db;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON DATABASE my_project_db TO my_project_user;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: If you are on Postgres 15 or higher, you might also need to grant schema permissions after connecting to the new DB:&lt;br&gt;
GRANT ALL ON SCHEMA public TO my_project_user;&lt;/p&gt;

&lt;p&gt;That’s it! Type &lt;code&gt;\q&lt;/code&gt; to exit. You can now connect your application to localhost using your new database, username, and password.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>database</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
