Articles in this section

Is it possible to install PostgreSQL 10.x or higher with Plesk?

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

Is it possible to install PostgreSQL 10.x or higher with Plesk?

Answer

Yes, Plesk supports PostgreSQL up to version 18.

Use the following steps to install PostgreSQL 10.x or higher with Plesk:

Installing PostgreSQL 10.X or higher on RHEL/AlmaLinux 8-9
  1. Connect to the server via SSH
  2. Get the PostgreSQL repository from https://www.postgresql.org/download/linux/redhat/
  3. Install the PostgreSQL repository (replace link with the one obtained in previous step):

    # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

  4. Disable the built-in PostgreSQL module:

    # dnf -qy module disable postgresql

  5. Install PostgreSQL (replace XX with the desired version):

    # dnf install -y postgresqlXX-server

  6. Initialize the database:

    # /usr/pgsql-XX/bin/postgresql-XX-setup initdb

  7. Set PostgreSQL to start on boot:

    # systemctl enable postgresql-XX

  8. Start PostgreSQL:

    # systemctl start postgresql-XX

  9. Create a symlink between installed version and postgresql service:

    # ln -s /usr/lib/systemd/system/postgresql-XX.service /usr/lib/systemd/system/postgresql.service

  10. Switch to user postgres:

    # su - postgres

  11. Set a password for the user:

    # psql -c "ALTER USER postgres WITH PASSWORD 'YourSecurePassword';"

  12. Log into Plesk
  13. Go to Tools & Settings > Database Servers
  14. Press Add Database Server
  15. Add PostgreSQL as a remote database server with the following values:
    • Database server type: PostgreSQL
    • Host name or IP address: 127.0.0.1
    • Check the box Use this server as default for PostgreSQL
    • Username: postgres
    • Password: password from step 11
  16. Press OK
Installing PostgreSQL 10.X or higher on Debian/Ubuntu
  1. Connect to the server via SSH
  2. Install necessary packages:

    # apt install curl ca-certificates postgresql-common

  3. Install the PostgreSQL repository:

    # /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

  4. Update repository data:

    # apt update

  5. Install PostgreSQL (replace XX with the desired version):

    # apt install postgresql-XX

  6. Set PostgreSQL to start on boot:

    # systemctl enable postgresql

  7. Start PostgreSQL:

    # systemctl start postgresql

  8. Switch to user postgres:

    # su - postgres

  9. Set a password for the user:

    # psql -c "ALTER USER postgres WITH PASSWORD 'YourSecurePassword';"

  10. Log into Plesk
  11. Go to Tools & Settings > Database Servers
  12. Press Add Database Server
  13. Add PostgreSQL as a remote database server with the following values:
    • Database server type: PostgreSQL
    • Host name or IP address: 127.0.0.1
    • Check the box Use this server as default for PostgreSQL
    • Username: postgres
    • Password: password from step 9
  14. Press OK
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.