In this PostgreSQL tutorial, we are diving into the realm of database management by demonstrating how to install PostgreSQL on a Windows operating system. We will follow the following steps:
- Step 1: Download PostgreSQL
- Step 2: Begin Installation
- Step 3: Select Components
- Step 4: Choose Installation Data Directory
- Step 5: Set a Password
- Step 6: Set the Port Number
- Step 7: Choose the Locale
- Step 8: Install
Step 1: Download PostgreSQL
From the official PostgreSQL website, first download the Windows installer. The webpage can be found on Community DL Page (enterprisedb.com) as of this writing. Make sure to choose the appropriate distribution and version for your Windows.
Step 2: Begin Installation
Run the installer after downloading the file. The installation process will be walked you through by a setup wizard. To proceed, select “Next”.
Then choose the desired installation directory.
Step 3: Select Components
You will then be prompted to choose the components you want to install. I advise adding the following components to a basic installation:
- PostgreSQL Server: The database server itself is called PostgreSQL Server.
- pgAdmin 4: A web-based PostgreSQL management tool is pgAdmin 4. It’s excellent for visually managing your databases.
- Command Line Tools: If you intend to connect with the database using command-line-based tools, these are helpful.
- Stack Builder: The PostgreSQL installation package includes the Stack Builder, which acts as a master installer for any extra packages you might want when using PostgreSQL.
Step 4: Choose Installation Data Directory
The data installation directory for PostgreSQL is then yours to choose. For most users, the default directory should be acceptable. Select what you want, then click “Next”.
Step 5: Set a Password
This action must be taken. The ‘postgres’ user, a superuser account in PostgreSQL, is having its password changed. Make a strong password choice and store it securely. To access the database, you must have this password. After entering your password, select “Next”.
Step 6: Set the Port Number
PostgreSQL’s standard port is 5432. Unless there is a problem with other applications or you have unique requirements, you’re usually fine leaving this at the default level. To proceed, click “Next”.
Step 7: Choose the Locale
You should generally leave the locale set to its default value. This will control your database’s language, sort order, and date format, among other things. Click “Next” once you have chosen your choice.
Step 8: Install
You can now begin installing PostgreSQL! The installation will start after pressing the “Next” button. Please feel free to get a cup of coffee because this could take a little while.
You see the Ready to Install wizard, then click on the “Next” button.
You will see the install progress wizard as shown in the below picture.
Step 9: Completing the Installation
The wizard will show a final screen after the installation is finished. Make sure the option to start Stack Builder when you quit is not selected (unless you want to add further drivers or tools). To end the wizard, click “Finish”.
Congratulations! PostgreSQL has been successfully installed on Windows.
You can launch the pgAdmin 4 utility from your list of installed programs to check the installation.
Your chosen “postgres” user password from the installation process will be required. If everything was installed properly, you ought to be able to connect to the PostgreSQL server and begin building databases.
In this PostgreSQL tutorial, we’ve walked you through the steps to install PostgreSQL on your Windows machine. Now, you’re ready to dive into the world of SQL and start managing your data.
You may like to read:
- PostgreSQL installation on Linux step by step
- What is PostgreSQL [Features & Disadvantages]
- How to Connect PostgreSQL Databases on Linux
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.