Skip to main content
Version: 6.11.0

PostgreSQL Installation

Installation

RHEL Installation

  1. Disable the built-in PostgreSQL module
    sudo dnf -qy module disable postgresql
  1. Enable the official PostgreSQL Yum Repository
    sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
  1. Install PostgreSQL
    sudo dnf install postgresql15-server -y
  1. Initialize the PostgreSQL database
    sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
  1. Start service on boot
    sudo systemctl enable postgresql-15.service
  1. Start the service
    sudo systemctl start postgresql-15.service
  1. Confirm that PostgreSQL is now started as a systemd service
    sudo systemctl status postgresql-15.service

Ubuntu Installation

  1. Create the repository configuration
    sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
  1. Import the repository signing key, and update the package lists
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  1. Update the package list
    sudo apt-get update
  1. Install PostgreSQL with a specific release version, see Minimum requirements section for supported versions.
    sudo apt-get -y install postgresql-15
  1. Confirm that PostgreSQL is now started as a systemd service
    sudo systemctl status postgresql

Portal Dedicated user account and database

Create User Account

Create a new user for access from the Portal Dedicated.

The examples create a user portal_db_user with a password of portal_db_password, but should be customised as required.

The username and password will be required to configure the Portal Dedicated.

echo "CREATE USER portal_db_user WITH PASSWORD 'portal_db_password'" | sudo su postgres -c "psql"

Create Database

Creates a new database for storage of Portal Dedicated data.

The examples create a database portal and is the recommended database name.

The -O flag specified the owner of the database and should match the user account created above, the example uses portal_db_user.

The database name will be required to configure the Portal Dedicated.

sudo su postgres -c 'createdb -O portal_db_user portal'

Configuration

The configuration files are located in different places depending on the OS and version of PostgreSQL.

  • Ubuntu: /etc/postgresql/15/main/
  • Centos: /var/lib/pgsql/15/data/

Enable remote access (optional)

Depending on the OS and version of PostgreSQL the database could be started with external access disabled.

If the database is not on the same server as the Portal Dedicated it will be required to edit the configuration to allow access.

Edit postgresql.conf in the relevant configuration directory and add/update the following property:

listen_addresses = '*'

which allows access from all hosts.

Enable MD5 password authentication

By default MD5 hashed password authentication is disabled, but is required for Portal Dedicated connections.

To enable, edit pg_hba.conf in the relevant configuration directory and:

  1. Change any mentions of ident to md5.
  2. Ensure the access methods for IPv4 connections is md5.
  3. Save and close the file.

Restart PostgreSQL with the new configuration:

Ubuntu

sudo systemctl restart postgresql

Rhel

sudo systemctl restart postgresql-15.service