Prerequisites to install the PEM server on Linux
================================================

You can install PEM on a single server, or you can install the web
application server and the backend database on two separate servers. You
must prepare your servers for PEM installation.

After completing the prerequisites, :ref:`Installing and Upgrading <Installing and Upgrading>`  and :ref:`Configure the email notifications <Configure the email notifications>`  PEM.
If you’re using two servers, install and configure PEM on both servers.

To install a PEM server on Linux, perform this preliminary
configuration:

1. Install a :ref:`supported Postgres instance </pem/latest/#postgres-compatibility>`  for PEM to use as a backend database. You can
   install this instance on the same server as you will use for the PEM
   web application or a separate server. You can also use an existing
   Postgres instance providing it is configured as detailed in steps 2
   and 3 below.

2. Configure authentication on the Postgres backend database by updating
   the ``pg_hba.conf`` file. You must make the following changes
   manually, prior to configuration. (Additional changes are made to
   this file during :ref:`Managing configuration settings <Managing configuration settings>`  .)

   -  To create the relations required for PEM, the PEM configuration
      script connects to the Postgres backend database as a superuser of
      your choice using password authentication. This requires you to
      permit your chosen superuser to authenticate using a password.
      This user must be able to connect from any location in which you
      run the configuration script. In practice, this means the server
      on which the backend database is located and the server on which
      the PEM web application is to be installed, if they’re different.

-  To allow the chosen superuser to connect using password
   authentication, add a line to ``pg_hba.conf`` that allows ``host``
   connections using ``md5`` or ``scram-sha-256`` authentication, for
   example, ``host all superusername 127.0.0.1/32 scram-sha-256`` .

..  Note::
   If you're using EDB Postgres Advanced Server, see  :ref:`Modifying the pg_hba.conf file <Modifying the pg_hba.conf file>`  .

If you’re using PostgreSQL, see `Client Authentication <https://www.postgresql.org/docs/current/auth-pg-hba-conf.html>`_  .

3. Verify that the ``sslutils`` extension is installed on your Postgres
   server. If you’re using PostgreSQL or EDB Postgres Extended Server on
   RHEL/AlmaLinux/Rocky Linux or SLES, you also need to install the
   ``hstore contrib`` module.

-  If you’re using EDB Postgres Advanced Server, you can install the
   ``sslutils`` extension as follows, where ``<x>`` is the EDB Postgres
   Advanced server version.

For RHEL/AlmaLinux/Rocky Linux 8/9:

.. code:: shell

           dnf install edb-as<x>-server-sslutils

For RHEL/OL/CentOS 7:

.. code:: shell

           yum install edb-as<x>-server-sslutils

For Debian/Ubuntu:

.. code:: shell

           apt install edb-as<x>-server-sslutils

For SLES:

edb_notranlate_3

-  If you’re using PostgreSQL, you can install the ``sslutils`` and, if
   required, ``hstore`` modules as follows, where ``<x>`` is the
   PostgreSQL version.

For RHEL/AlmaLinux/Rocky Linux 8/9:

.. code:: shell

           dnf install sslutils_<x> postgresql<x>-contrib

For RHEL/OL/CentOS 7:

.. code:: shell

           yum install sslutils_<x> postgresql<x>-contrib

For Debian/Ubuntu:

.. code:: shell

           apt install postgresql-<x>-sslutils

For SLES:

.. code:: shell

           zypper install sslutils_<x> postgresql<x>-contrib
       
       -   If youre using EDB Postgres Extended Server, you can install the `sslutils` and, if required, `hstore` modules as follows, where `<x>` is the EDB Postgres Extended Server version. 

           For RHEL/AlmaLinux/Rocky Linux 8/9:
   ``` shell dnf install edb-postgresextended<x>-sslutils edb-postgresextended<x>-contrib

::

       For RHEL/OL/CentOS 7:

\``\` shell yum install edb-postgresextended-sslutils
edb-postgresextended-contrib

::


           For Debian/Ubuntu:
   ``` shell apt install edb-postgresextended-sslutils-<x>

::

       For SLES:

\``\` shell zypper install edb-postgresextended-sslutils
edb-postgresextended-contrib

edb_notranlate_11 shell firewall-cmd –permanent –zone=public
–add-port=8443/tcp firewall-cmd –reload

edb_notranlate_12 shell iptables -t filter -A INPUT -p TCP –dport 8443
-j ACCEPT

::



   5. Make sure the components Postgres Enterprise Manager depends on are up to date on all servers. You can do this by updating the whole system using your package manager as shown below.
      If you prefer to update individual packages, a full list of dependencies is provided in [Dependencies of the PEM Server and Agent on Linux](dependencies.md).

        For RHEL/AlmaLinux/Rocky Linux 8:

   ``` shell dnf upgrade

::

    For RHEL/OL/CentOS 7:

\``\` shell yum upgrade

::


       For Debian/Ubuntu:
   ``` shell apt-get update

::

   For SLES:

``shell zypper update``

Supported locales
-----------------

Currently, the Postgres Enterprise Manager server and web interface
support a locale of ``English(US) en_US`` and use of a period (.) as a
language separator character. Using an alternate locale or a separator
character other than a period might cause errors.
