DEV Community

Jimmy McBride
Jimmy McBride Subscriber

Posted on β€’ Edited on

7 3

How To Install PostgreSQL On Windows 10

And Use It From Your Terminal

Installation Instructions

Go to PostgreSQL Database Download and download the version of PostgreSQL you want under the "Windows x86-64" column. Once the installer is done downloading, run that bad boy.

Download PostgreSQL

Once you run the installer you downloaded, you should see a screen that looks like this:

PostgreSQL installer

Click Next >. Then choose your installation directory:

Alt Text

Select components. I would leave all these checked and click Next >.

PostgreSQL components

Select the data directory. I left its default value.

PostgreSQL data directory

Set up a password for your PostgreSQL user. Do something that's really easy to remember. If you're not worried about somebody hacking and finding sensitive data in your local PostgreSQL data, you would probably be fine setting it to password.

PostgreSQL password

Set up PostgreSQL port. Default is 5432, I recommend leaving it like that.

PostgreSQL port

Choose your locale. I speak English and I'm from the United States, so I choose English, United States.

PostgreSQL locale

Once we get to the pre-installation, click Next >.

PostgreSQL pre-installation

Then click Next > again and it install will start!

Install PostgreSQL

Now, in your Windows search bar, type: Edit the system environment variables. Click on that and you should see this:

Windows env vars

Then click on the Environment Variables button.

User env vars

Click on PATH under user variables and then Edit... and then add the path to your PostgreSQL's bin folder to the list of locations in your PATH variable.

PostgreSQL path

Click OK then OK and OK again. Once you've closed out of everything you should open up your terminal and type psql -U postgres and it will ask you for PostgreSQL's password. Whatever you set it as during the installer will be what you want to type in, and tada! πŸŽ‰ You can now use PostgreSQL in the terminal now!

Image of Quadratic

AI, code, and data connections in a familiar spreadsheet UI

Simplify data analysis by connecting directly to your database or API, writing code, and using the latest LLMs.

Try Quadratic free

Top comments (0)

Image of Quadratic

Python + AI + Spreadsheet

Chat with your data and get insights in seconds with the all-in-one spreadsheet that connects to your data, supports code natively, and has built-in AI.

Try Quadratic free

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay