Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

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:

  1. Download the PostgreSQL installer from PostgreSQL official website.
  2. Run the downloaded installer file (.exe).
  3. Follow the installation wizard instructions. Choose installation directory, data directory, and password for the database superuser (postgres).
  4. Complete the installation process.
  5. 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:

  1. Download the PostgreSQL installer for macOS from PostgreSQL official website.
  2. Open the downloaded .dmg file and double-click on the PostgreSQL package icon to start the installer.
  3. Follow the prompts to complete the installation, including setting a password for the database superuser (postgres).
  4. 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:

  1. Open a terminal window.
  2. Update the package list: sudo apt update.
  3. Install PostgreSQL and its contrib package: sudo apt install postgresql postgresql-contrib.
  4. PostgreSQL service will start automatically. You can manage it using systemctl commands like sudo systemctl start postgresql and sudo systemctl stop postgresql.
  5. Optionally, configure PostgreSQL to start on boot: sudo systemctl enable postgresql.