Getting Started - Installing PostgreSQL
Introduction
PostgreSQL is an advanced open-source relational database management system. Installing PostgreSQL involves several steps depending on your operating system.
Installing PostgreSQL on Windows
Follow these steps to install PostgreSQL on a Windows system:
- Download the PostgreSQL installer from PostgreSQL official website.
- Run the downloaded installer file (.exe).
- Follow the installation wizard instructions. Choose installation directory, data directory, and password for the database superuser (postgres).
- Complete the installation process.
- After installation, PostgreSQL service will start automatically. Optionally, you can start/stop it from Windows services.
Installing PostgreSQL on macOS
To install PostgreSQL on macOS, proceed as follows:
- Download the PostgreSQL installer for macOS from PostgreSQL official website.
- Open the downloaded .dmg file and double-click on the PostgreSQL package icon to start the installer.
- Follow the prompts to complete the installation, including setting a password for the database superuser (postgres).
- PostgreSQL will be installed in the /Library/PostgreSQL directory by default.
Installing PostgreSQL on Linux (Ubuntu)
Installing PostgreSQL on Ubuntu Linux can be done via terminal:
- Open a terminal window.
- Update the package list:
sudo apt update
. - Install PostgreSQL and its contrib package:
sudo apt install postgresql postgresql-contrib
. - PostgreSQL service will start automatically. You can manage it using
systemctl
commands likesudo systemctl start postgresql
andsudo systemctl stop postgresql
. - Optionally, configure PostgreSQL to start on boot:
sudo systemctl enable postgresql
.