Introduction To Relational Databases Using Postgres
Installing Postgres in Local System | Windows
S Soumen
Oct 3, 2023

Installing PostgreSQL on Windows and Linux Machines

Installing PostgreSQL on Windows

 1: Download the Installer Visit the official PostgreSQL download page for Windows: https://www.postgresql.org/download/windows/Click on the 'Download the installer' link and choose the latest version compatible with your system.

2: Run the Installer Once downloaded, run the installer executable file. Follow the on-screen instructions. The setup wizard will prompt you to select components to install. You can choose the PostgreSQL Server, pgAdmin (a popular administration and development platform for PostgreSQL), command line tools, and additional components.

3: Choose Installation Directory Specify the directory where you want PostgreSQL installed or use the default path provided.

4: Enter a Password for the Database rootUser(postgres) Set a strong password for the default superuser account 'postgres'. This account is used for administrative tasks, so ensure the password is secure.

5: Select a Port The installer will suggest a default port (usually 5432) for PostgreSQL to listen on. You can use this default port or specify another if the default is in use.

6: Installation and Configuration The installer will then install and configure PostgreSQL. This process might take a few minutes.

 7: Launching the Application Once installed, you can launch pgAdmin or psql shell from the Start menu to manage your PostgreSQL databases.

Installing PostgreSQL on Linux

The installation steps can vary depending on the Linux distribution. Here, we'll cover the process for Ubuntu. Ubuntu 1: Update Package List Open a terminal and run:

sudo apt-get update

2: Install PostgreSQL Install PostgreSQL along with the -contrib package that adds some additional utilities and functionality:

sudo apt-get install postgresql postgresql-contrib

 3: Start the PostgreSQL Service Start the service with:

sudo systemctl start postgresql

Have a doubt?
Post it here, our mentors will help you out.