https://docs.fusionpbx.com/en/latest/hardware.html
https://docs.fusionpbx.com/en/latest/applications/provision/provision_auto_grandstream.html
Basic steps:
Fusionpbx:
In Advanced>default settings under "Provision":
Set enabled to true
Set "http_auth_enabled" to true
Set "http_auth_username" to a username you will later enter into the phone
Set "http_auth_password" to a secure password you will later enter into the phone
Optionally set "cidr" to the IP range the phones will be provisioning from for higher security. Additional "cidr" entries can be added as needed.
When finished, click "Reload" at top right of page
In Accounts>Devices
Add new entry
Enter MAC address of phone
Select a template (there should be a good gxp2140 template available)
Optionally add account info manually or easily add it in step below
Enter a description of phone to find it easier later
Save
In Accounts>Extensions
Edit an extension you want to use
Under Device Provisioning select Line 1, click drop down to select MAC you added earlier, click add. The template will auto fill if the MAC is already in Devices.
Another way to add device MAC's is directly from this screen. Instead of selecting an existing MAC, click the edit icon and enter in a new MAC, then select correct template, then add. This will add the MAC to the devices page with all of the relevant info.
In the Grandstream:
Maintenance>Upgrade and Provisioning page
Set "Config Upgrade via" to HTTPS
Set "Config Upgrade Server Path" to <your.fusionpbx.server>/app/provision
Set "Config Server Username" to the http_auth_username you set earlier
Set "Config Server Password" to the http_auth_password you set earlier
Click Save and Apply
Then Click "provision" at top of page or restart phone
Phone should now be provisioned.
There are many more options available to customize settings and ways to easily manage button configs etc. Most of these can be figured out by reading the docs, testing things, etc. Further examples and documentation is available to Fusionpbx.com Green members in the member documentation and Admin class videos.