Installing P4 Plan Web on macOS

Perform the following tasks to install and configure P4 Plan Web on macOS.

1. If nginx is not installed, install it using the following:

Copy
brew update
brew install nginx

2. Download and install an LTS version of node.js, v22 or later.

3. Download P4 Plan Web and unzip it to your desired install location.

4. In P4PlanAPI, rename config-example.env to .env.

5. Configure the server details in .env as required.

If you change the "port=4000" setting, you also need to update it in nginx.conf.

6. Navigate to P4PlanWeb/P4PlanAPI/ and run:

Copy
npm ci --omit=dev --no-audit

7. In ./certificates, replace the existing certificate example with your own.

This can either be a certificate acquired from a certificate authority or a self-signed certificate, generated locally with OpenSSL. The following is an example for generating a self-signed certificate with OpenSSL:

Copy
openssl req -new -newkey rsa:2048 -nodes -days 365 -keyout ./certificates/web.key -out ./certificates/web.pem

Example certificates are provided, which you can use to get up and running. To use these, rename the example files to web.key and web.pem.

The example certificates are for testing purposes only, and do not create a secure connection.

8. Copy client files to the web root directory - for example: /usr/local/var/www/

Copy
cp -r client/dist/* /usr/local/var/www/
cp -r integrations/helix_core /usr/local/var/www/

9. Copy certificates folder into the nginx directory:

Copy
cp -r certificates /usr/local/etc/nginx/

10. (Optional) To keep the /usr/local/etc/nginx/nginx.conf file, back it up.

If you have a nginx.conf file, you can merge applicable pieces from nginx-example.conf into your existing nginx.conf file. If you do this, you should skip Step 11.

11. Copy the example file:

Copy
cp nginx-example.conf /usr/local/etc/nginx/nginx.conf

12. Edit paths in /usr/local/etc/nginx/nginx.conf to match the paths on your file system:

Copy
a. 
include /usr/local/etc/nginx/mime.types;

b.
ssl_certificate /usr/local/etc/nginx/certificates/web.pem;
ssl_certificate_key /usr/local/etc/nginx/certificates/web.key;

c.
root  /usr/local/var/www/;

d.
alias  /usr/local/var/www/helix_core/htmlwindows.template;

13. Start nginx as a service:

Copy
 brew services start nginx

14. If you want to install the optional Integrations server, navigate to the integrations folder and rename config-example.env to .env.

If you do not want to install integrations, skip to step 17.

15. Update the variables in the .env file as follows, making sure to match the values defined in the P4PlanAPI/.env file:

Copy
integrationServiceID=anything //any string should work but ideally something obscure
port=4000 // API's port
integrationPort=5001 // Integrations port

16. Install dependencies inside the integrations folder:

Copy
npm ci --omit=dev --no-audit

17. Run ./start.sh to start P4 Plan API and integration servers.

18. Visit https://localhost

19. (Optional) If you want to enable API development on your server, refer to Step 6: Verify that the service has started.

20. If you want to let users open the P4 Plan desktop client from the web client, set the hostname for the P4 Plan Server.