Installing unattended Postgres

Installing Postgres needs to compile the sources from scratch if you do not prefer a pre-compiled installer such as enterprise-db or big-sql. I generally prefer to use enterprise-db installer which I believe is one of the most complete installer for Postgres Database.

Download Postgresql

Simply go to the enterprise-db download site and select the environment and the version for your compiled Postgres installer.

Install Postgresql Software

After the download completes, copy the downloaded file to your remote OS, or on the server you want to do the installation. Unzip the files and start the installer with the following parameters.

./postgresql-9.6.11-1-linux-x64.run \
--mode unattended \
--prefix /home/hadoop/postgres \
--datadir /home/hadoop/postgres/data \
--serviceaccount postgres \
--superaccount postgres \
--superpassword welcome1 \
--extract-only 1 \
--serverport 5432

This unattended mode does not need an X Window manager for the installing procedure and silently installs Postgres database. As you can also be aware of the --extract-only option is set to true. I usually prefer to install the binaries and then create the databases with the createdb option after running the initdb for initializing the data directory as follows.

Create Database

initdb -D <data directory>

createdb -O <role name> <database name>

Last updated

Was this helpful?