Install PostgreSQL

Overview and generalities

  • By default every Postgres installation comes with one database already created called "postgres"

  • This is important because Postgres requires you to specify the name of the database to make a connection, so there needs to always be one database

Linux Debian

  • Install Packages

sudo apt update && sudo apt install postgresql postgresql-contrib
  • Once the installation is complete, the PostgreSQL service will start. To verify the installation, use the psql tool to print the server version

sudo -u postgres psql -c "SELECT version();"

Output should look like:

PostgreSQL 11.5 (Debian 11.5-1+deb10u1) on x86_64-pc-linux-gnu, 
compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

Windows

  • Download installer from the Postgres Downloads URL

  • Follow the Wizard like any other app

  • Select path where you want installed (Usually left default)

  • Select additional components to be installed

  • Pass in the password for the superuser

  • Pass in the Database Port (Default: 5432)

  • Click next on the rest and this will start the install

Last updated