How is the FPM Port assigned?

When I create a new virtual server instance, I’ve discovered that I need to turn on PHP FPM before making any changes to the instances nginx conf file. That way, Virtualmin will create a new port to access a custom FPM config for that instance and update it in the nginx conf file. This is great since it auto assigns the server instance user as the default user for FPM (instead of “www-data”, which complicates things).

This results in code that looks like this:

location ~ \.php$ {
		try_files $uri =404;
		fastcgi_pass localhost:8007;

But I’ve noticed that I can’t use that port number configuration on a different virtual server.

I need to backtrack on some server instances where I didn’t set up PHP FPM at the outset (and therefore it does not update my conf file to include the assigned port number).

Where is this configuration stored? How can I create a new configuration for an existing non-FPM server? (Please provide the exact file path if you know the answer, since I don’t fully understand where standard things like this are stored.)

Thank you!!!

I found domain config files in


And for the domain I’m focused on, I changed the php-fpm version there from 7.2 to 7.4 (both of which are installed with FPM packages).


  • How do I get these to take effect?

  • Can I add lines like this to the config file for domains currently running fcgi?


  • Where are the port definitions stored and how are they allocated?

  • Is there anything else that needs to be done to ensure FPM runs under the server’s primary user (which is also stored in this file)?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.