Overview
A server group is a named pool of servers. Rather than assigning a product to a specific server, you assign it to a server group. On each new order, Commerce picks the best available server in the group automatically.
This decouples your product catalog from your infrastructure — add capacity by adding a server to the group, with no product reconfiguration required.
Location: Admin → Infrastructure → Server Groups
Why Use Server Groups
| Scenario | Benefit |
|---|---|
| Single server | Use a group with one server. Same workflow regardless of future expansion. |
| Multiple servers, same product type | Load spread automatically across all servers in the group. |
| Geographic separation | Create "EU Shared" and "US Shared" groups; offer them as separate products. |
| Panel type separation | Different groups for Opterius Panel vs other panel types. |
Creating a Server Group
- Go to Admin → Infrastructure → Server Groups → Create Group.
- Fill in:
- Name — displayed in product config (e.g. "EU Shared Hosting", "US VPS Pool").
- Description (optional) — internal note for your team.
- Save.
The group is now available when adding or editing servers.
Assigning Servers to a Group
Server group membership is set on the server record, not on the group itself.
- Go to Admin → Infrastructure → Servers → edit a server.
- Set the Server Group field to the desired group.
- Save.
A server can belong to only one group at a time. To move a server to a different group, edit the server and select the new group. Existing services on that server are unaffected.
Linking a Server Group to a Product
- Go to Admin → Products → edit a hosting product.
- In the Provisioning tab, select the server group from the Server Group dropdown.
- Optionally set the Package Name (the plan name as configured on the Panel).
- Save.
All new orders for this product will provision on servers in the selected group.
Load Balancing: bestServer()
When a new order is placed, Commerce calls ServerGroup::bestServer(), which:
- Queries all servers in the group.
- For each server, calculates free slots =
max_accounts− active service count. - Returns the server with the most free slots.
- If all servers are at capacity (free slots = 0), provisioning is held and admin is notified.
Commerce counts its own service records to measure capacity. It does not query the Panel API in real time. See Capacity Tracking for details.
Removing a Server from a Group
Edit the server and clear the Server Group field (set to "None"). The server will no longer receive new orders. Existing services are not affected.
Do not remove a server from a group while its services are still active unless you are decommissioning it — suspended services may still need unsuspension or termination jobs to run against this server.