Installing PostgreSQL on Linux

Learn how to install PostgreSQL for Analytics Content Hub on Linux® platforms.

Procedure

  1. Apply Linux updates:
    sudo apt-get update
  2. Enable the PostgreSQL repository:
    sudo apt install postgresql
  3. Allow other computers to connect to PostgreSQL:
    sudo vi /etc/postgresql/16/main/postgresql.conf
  4. Change the listen_address from localhost to *.
  5. Set the password for the PostgreSQL user:
    sudo -u postgres psql template1
  6. Run the following SQL command with your own password value:
    alter user postgres with encrypted password ‘password_example’;
  7. Type in the exit command.
  8. Change the authentication for the PostgreSQL user allowed for the template1 database to use the md5 authentication:
    sudo vi /etc/postgresql/16/main/pg_hba.conf
  9. Add the following line and change the <local network IP> to your private IP value:
    hostssl template1 all <local network IP> md5
  10. Restart PostgreSQL:
    sudo systemctl restart postgresql.service
  11. Create a PostgreSQL user for the Analytics Content Hub content store:
    sudo -u postgres psql template1
  12. When the template1=# prompt appears, run the following SQL with your own password value:
    create user achadmin password 'password_example';
  13. Create the Analytics Content Hub database:
    create database analyticscontenthub;
  14. Give the database permission to the admin:
    grant all on database digitalhive to dhadmin;
  15. Give the CREATEROLE permission to the admin:
    alter role dhadmin with CREATEROLE;
  16. Exit the PostgreSQL by using the exit command.