Server Provisioning
When a hosting service is paid for, ProEcommerce creates the account on your server automatically. When the client cancels or gets terminated for non-payment, it tears the account down. All via the server's native API.
Supported control panels
| Panel | Status | Notes |
|---|---|---|
| cPanel / WHM | Production | WHM API 1, token auth, full lifecycle |
| CloudPanel | Production | CLI-based provisioning over SSH |
| Plesk | Planned | REST API wired, awaiting test servers |
| DirectAdmin | Planned | Q3 roadmap |
How provisioning works
- A service's status transitions to
active(typically when its first invoice is paid) - ProEcommerce queues a
provisionjob with all the parameters - The
provisioning-runnercron (every 2 minutes) picks up pending jobs - The job calls the control panel's API (WHM, CloudPanel, etc.) with your stored credentials
- On success: the service record stores the created username and server ID, a welcome email goes out, and the service is fully live
- On failure: the job retries with exponential backoff up to 5 times before alerting the admin
Adding a server
In the admin dashboard: Servers → Add Server. You'll need:
- Hostname (IP or FQDN)
- Panel type (cPanel, CloudPanel, etc.)
- API credentials:
- cPanel: root WHM username + API token (not the root password)
- CloudPanel: SSH user + private key (key stays encrypted in DB)
- Default package / plan name that exists on the server
- Max accounts (soft cap for assignment load balancing)
Server groups
Group servers by purpose ("USA East shared", "EU reseller", "Premium SSD") and assign products to groups rather than specific servers. New accounts are distributed across healthy servers in the group using a least-loaded algorithm.
Lifecycle actions
Create
Calls createacct (WHM) or site:add (CloudPanel)
with the client's chosen username, domain, and package. Returns the
server-side account ID which we store for future reference.
Suspend
Triggered when payment goes past the suspension threshold (default: day 10
overdue). Calls suspendacct — the account is no longer
accessible but data is retained intact.
Unsuspend
Fires automatically when a previously-overdue invoice is paid. Calls
unsuspendacct. The account comes back online within seconds.
Terminate
Triggered 45 days past-due (configurable). Calls removeacct —
data is destroyed on the server. A final backup is pulled to your
"recovery" S3 bucket before destruction if you have that policy enabled.
Change package
Upgrades/downgrades call changepackage with the new plan. The
server applies new limits (disk, bandwidth, email accounts) immediately
and issues a prorated invoice for the difference.
Module development
Need a control panel we don't support yet? Write a provisioning module.
Each module extends ProvisioningModule and implements six
methods:
abstract class ProvisioningModule {
abstract public function create(Service $s): Result;
abstract public function suspend(Service $s): Result;
abstract public function unsuspend(Service $s): Result;
abstract public function terminate(Service $s): Result;
abstract public function changePackage(Service $s, string $newPackage): Result;
abstract public function testConnection(Server $srv): Result;
}
Drop your implementation in includes/provisioning/ and it
becomes selectable in the product editor.