Step-by-step guide on installing Postgres Enterprise Manager for windows.
Tags: postgres, pem, database, bitnine
Published: 2023-07-15 16:08:01

**Introduction**

Postgres Enterprise Manager (PEM) is a monitoring tool used for managing multiple instances of Postgres databases. It offers the flexibility of installation on Windows either through a Linux distribution like Ubuntu or directly as an executor. 

**Installation Guide.**
There are different options for installing the PEM server. In this article, we will focus on installing the PEM server via the Stack Builder after installing EDB Postgres Advanced Server. This installation can also be done through the stack builder utility of PostgreSQL. The EDB extended advanced server will serve as the Postgres instance we will be monitoring. 

Before the Installation guide, you need to know the following.
- The PEM Server requires a backend Postgres instance that it will use to store monitored data.
- This database can be EDB advanced server or PostgreSQL with a database known as PEM inside of it.
- PEM can use an existing Postgres in your local machine, or you will be prompted to install a new one as the backend database.
- The PEM HTTPD may or may not be in the same machine as the host of PEM server.
- The PEM Agent can remotely manage a host, it must not be in the same machine as the host.
- Visit [this](https://dev.to/chidera/postgres-enterprise-managerpem-a-quick-overview-15fb) blog post for further reading.

**EDB Postgres Advanced Server Installation Guide.**

1. Begin by creating an account on [EnterpriseDB website] (https://www.enterprisedb.com/products/postgres-enterprise-manager). 

2. Navigate to the installation [page](https://www.enterprisedb.com/software-downloads-postgres) and select the first option, EDB Postgres Advanced Server, choose Windows installer as can be seen in the image below.

    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uok333jpzphd3p8dez38.jpg)
3. This will either start the installation automatically or provide you with a link to click on.
4. Right-click on the downloaded file and select **Run as administrator** to initiate the installation.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofr93pwepyjn0kz2e5es.jpg)

5. The installation wizard will appear. Click "Next" to proceed.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4j34r7884gkpich51o74.jpg)

6. Accept the licence agreement and click "next" to proceed. 

7. Choose the installation directory or keep the default setting, then click "Next".

8. Select the components to install (the default selection is fine) and click "Next".

9. Specify the data directory or stick with the default setting, and click "Next".

10. Here you will be presented with two options as seen in the picture below. Click on next after selecting an option.

    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8vbc9pe229tmkvjqg85.jpg)

11. Set a password for the database superuser and remember it for future use.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bi9w33hw765f38agi0ax.jpg)

12. Specify the port number and the locale, (you can stick with the defaults).

13. Select the type of server, this helps in determining the amount of system resources that will be used, I left mine at development.

13. Select the type of workload, again I left mine at default.

14. Review the pre-installation summary and click "Next" to start the installation.
15. Once the setup is complete, you'll see the installation summary as shown in the screen below. Leave it at the default setting to proceed with using the Stack Builder utility for additional downloads.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fkm0rbvyeesw6t0jbck6.jpg)

**PEM HTTPD, PEM Server and PEM Agent installation Guide**

1. Select EDB Advanced Server as the software you're installing. Ensure you have an internet connection.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vu5aks2w5pc9s51l52ue.jpg)

2. Select the applications you want to install, such as pgAdmin, PEM Agent v9.2.2-1 and PEM server 9.2.2-1.

    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/35h81csl0yh11owgcpdk.jpg)
3. Review your selections and click "Next". Specify the download directory (you can keep the default).
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eywx5p6geq43j5zu3v93.jpg).
4. The download process will begin. Once completed, click "Next" to start the installation.
5. During installation, choose your preferred language (English, for example).
6. Follow the installation steps for each selected application, such as pgAdmin.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/movk0wz5r2zugo1i4iie.jpg)
7. Return to the Stack Builder and click "Next" to proceed with the installation of PEM-HTTPD.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8stmg7iiieh4r70xyvv.jpg)
8. Specify the installation directory for PEM-HTTPD and click "Next".
9. Configure the port for Apache (you can keep the default) and click "Next".

10. The installation process will begin. Once finished, click "Finish".

11. Go back to the Stack Builder, click "Next", and install the PEM Agent.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksorahshdx4zql7atoc2.jpg)

12. Accept the agreement and choose the installation directory for the PEM Agent.

13. If a missing dependency is detected, click "Next" to install PostgreSQL.

14. Go back to stack builder and click on next, provide the password for the PEM Agent (your (system)HP user's password) and click "Next".

    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5almrqr12xzo4r6l6si.jpg)

15. Choose the network address (default is fine) and specify the agent description.

16. Click "Next" to start the installation.

17. After the installation, an alert will confirm that the PEM server has been configured with the PEM Agent.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zo8kozms5d7pf1ovah3k.jpg)

18. Click "Finish" and return to the Stack Builder. Click "Finish" again.
19. To confirm the installation, open your Chrome browser and enter and visit this URL-https://ip_address_of_pem_host:8443/pem. Select "Advanced" to proceed. This will take a while and will output the image below on the screen.

    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zew5akjwz267390vtzrc.jpg)
20. To know your IP address, open the command prompt and type this  `ipconfig /all`, copy the ipv4 address and use it appropriately in the URL above.

21. You can skip the last step by clicking on **start > select Postgres Enterprise Manager > PEM web client** to open PEM in the browser.

**Conclusion.**
Postgres Enterprise Manager (PEM) is a powerful tool designed for monitoring multiple instances of Postgres. The installation guide outlined the step-by-step process to install PEM, including the installation of EDB Postgres Advanced Server (as the server you will be monitoring), PEM HTTPD, PEM Server with PostgreSQL as the backend database and PEM Agent all on the same host. For an installation guide on how to install these components separately on different hosts, please visit the EDB official documentation.

**References**
https://www.enterprisedb.com/docs/pem/latest/installing/
https://www.enterprisedb.com/docs/pem/latest/installing/windows/

**Please do give me a like and a follow if you enjoyed this post.**