PostgreSQL is a powerful, open-source relational database management system. It is known for its stability, scalability, and flexibility, making it a popular choice for enterprise applications and large-scale data processing. In this guide, we will go through the process of installing PostgreSQL on various operating systems, including Windows, MacOS, and Linux.
Before installing PostgreSQL, it is important to ensure that your system meets the minimum requirements. These include:
- 64-bit operating system
- At least 1 GB of RAM
- At least 1 GB of free disk space
It is recommended to have at least 4 GB of RAM and 10 GB of free disk space for optimal performance.
1. Download PostgreSQL Installer for Windows
The PostgreSQL installer download page on the EnterpriseDB is where you should start >> https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
Following that, click the download link as seen below:
2. Install PostgreSQL on Window step by step
You must have administrator rights in order to install PostgreSQL on Windows.
Step 1: Double-click the installer file to launch the installation wizard. The wizard will walk you through a series of phases where you may select the various PostgreSQL features you want.
Step 2: Press the Next button.
Step 3: Select an installation folder, either your own or the one the PostgreSQL installer recommends, and then click the Next button.
Step 4: Choose the software components you want to install:
- Installing the PostgreSQL database server requires the PostgreSQL server.
- Installing PostgreSQL database GUI administration tool pgAdmin 4.
- To install command-line tools like psql, pg restore, etc., use command-line tools. You may use the command-line interface to communicate with the PostgreSQL database server using these tools.
- You may download and install PostgreSQL drivers using the GUI that Stack Builder offers.
You don’t need to install Stack Builder to follow the instruction on this page, therefore feel free to uncheck it before choosing the data directory by clicking the Next button:
Step 5: Either accept the default folder or choose the database path to store the data in. To go on to the following phase, click the Next button:
Step 6: Type the database superuser password (postgres)
Under a service account called postgres, PostgreSQL operates in the background. If you’ve previously created a service account called postgres, you’ll need to enter its password in the next box.
You must type the password again to confirm it before clicking the Next button:
Step 7: Select the port where the PostgreSQL database server will listen. PostgreSQL’s standard port is 5432. Verify that no other programs are currently utilizing this port.
Step 8: Decide which language the PostgreSQL database will use by default. PostgreSQL will utilize the operating system locale if the default locale setting is left in place. then press the Next button.
Step 9: The installation wizard will display PostgreSQL’s summary data. If everything is correct, you must check it and press the Next button. If not, you must click the Back button to adjust the setup as necessary.
Step 10: To complete the PostgreSQL installation, click the Finish option.
3. Verify the Installation
There are several methods for checking the PostgreSQL installation. You can attempt to establish a connection to the PostgreSQL database server using any client program, such as psql and pgAdmin.
Launch the psql program by clicking it first. It will display the psql command-line tool.
Next, fill up all the required details, including the server, database, port, username, and password. Pressing Enter will allow you to accept the default. Keep in mind that you must enter the PostgreSQL password that you supplied during installation.
Server [localhost]: Database [postgres]: Port : Username [postgres]: Password for user postgres: psql (12.3) WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. Type "help" for help. postgres=#
Congratulation! On your local PC, PostgreSQL database server has been installed successfully. Let’s explore different connections to the PostgreSQL database server.
Thanks for reading. Happy coding!