Installing PostgreSQL on Linux
Learn how to install PostgreSQL for Analytics Content Hub on Linux® platforms.
Procedure
-
Apply Linux updates:
sudo apt-get update - Enable the PostgreSQL repository:
sudo apt install postgresql - Allow other computers to connect to PostgreSQL:
sudo vi /etc/postgresql/16/main/postgresql.conf - Change the
listen_addressfrom localhost to *. - Set the password for the PostgreSQL user:
sudo -u postgres psql template1 - Run the following SQL command with your own password value:
alter user postgres with encrypted password ‘password_example’; - Type in the exit command.
- 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 - Add the following line and change the <local network IP> to your
private IP value:
hostssl template1 all <local network IP> md5 - Restart PostgreSQL:
sudo systemctl restart postgresql.service - Create a PostgreSQL user for the Analytics Content Hub content store:
sudo -u postgres psql template1 - When the
template1=#prompt appears, run the following SQL with your own password value:create user achadmin password 'password_example'; - Create the Analytics Content Hub database:
create database analyticscontenthub; - Give the database permission to the admin:
grant all on database digitalhive to dhadmin; - Give the
CREATEROLEpermission to the admin:alter role dhadmin with CREATEROLE; - Exit the PostgreSQL by using the exit command.