How to create a new subscription/domain using CLI on Linux

Applicable to:

Question

How to create a new subscription/domain using command line utilities (CLI)?

Answer

To create a subscription, one of the following CLI utilities can be used:

a. The
/usr/local/psa/bin/subscription utility. Go to documentation to get a detailed explanation how it should be used. It can be executed using the following way:

# plesk bin subscription

b. The
/usr/local/psa/bin/domain utility.To get detailed explanation how it should be used run
/usr/local/psa/bin/domain --help. It can be executed using the following way:

# plesk bin domain

Here is an example how to create a new subscription for the administrator's customer with the username
john based on the hosting plan
Default Domain, set up a site for the domain,
example.com assign IP address 203.0.113.2 to the subscription, and set the username
john
and password
userpass for access to the webspace: