The wwwacct Script

Valid for versions 100 through the latest version

Version:

100

Last modified: July 28, 2022


Overview

This script creates a new cPanel account.

Note:

You can also create an account with the WHM API 1 createacct function.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/wwwacct domain user pass [options]
Note:
  • You must specify all options in the following order. If you do not include all options, the script may apply values to incorrect options and will set the remaining options to default values.
/usr/local/cpanel/scripts/wwwacct <domain> <user> <pass> <quota> <cpmod[advanced/?]> <ip[y/n]> <cgi[y/n]> <frontpage[always n]> <maxftp> <maxsql> <maxpop> <maxlst> <maxsub> <bwlimit> <hasshell[y]/[n]> <owner> <plan> <maxpark> <maxaddon> <featurelist> <contactemail> <use_registered_nameservers> <language> <spamassassin[Y/n]> <max_emailacct_quota> <spambox[Y/n]>

Example

The following example creates an account with the values shown in the screenshot below.

/usr/local/cpanel/scripts/wwwacct example.com username luggage123456 123 jupiter n n n unlimited 4 6 8 10 unlimited n root default 10 10 default [email protected] y EN y 10

Options

Use the following options with this script:

Options Description Example
domain Required.
The account’s main domain.
example.com
user or username Required.
The new account’s username. cPanel usernames must adhere to the following criteria:
  • The first eight characters of a username must be unique.
  • A username cannot begin with a number or the test string.
username
pass or password Required.
The account’s password.
luggage123456
bwlimit The account’s maximum bandwidth.
  • A positive integer.
  • 0, unlimited, or null — The account possesses unlimited bandwidth.
This value defaults to unlimited.
0
cgi Whether the account has CGI access.
  • y — CGI access enabled.
  • n — CGI access disabled.
y
quota The account’s disk space quota.
  • A positive integer.
  • 0 — The account’s disk space is unlimited.
This value defaults to 0 (unlimited).
0
cpmod The account’s cPanel theme.

This value defaults to the server’s default Theme setting.
jupiter
ip Whether the account has a dedicated IP address.
  • y — The account has a dedicated IP address.
  • n — The account does not have a dedicated IP address.
This value defaults to n.
n
frontpage Whether Microsoft® FrontPage® Extensions exist on the account.
Important:
This option is deprecated. cPanel & WHM ignores all FrontPage settings.
n
maxftp The account’s maximum number of FTP accounts.
  • A positive integer.
  • 0, unlimited, or null — The account can create unlimited FTP accounts.
This value defaults to unlimited.
0
maxsql The account’s maximum number of each available type of SQL database. For example, this parameter has a 5 value and the system administrator allows MySQL® and PostgreSQL® databases. Users can create up to five MySQL databases and up to five PostgreSQL databases.
  • A positive integer.
  • 0, unlimited, or null — The account can create unlimited SQL databases.
This value defaults to unlimited.
0
maxpop The account’s maximum number of email addresses.
  • A positive integer.
  • 0, unlimited, or null — The account can create unlimited email accounts.
This value defaults to unlimited.
0
maxlst The account’s maximum number of Mailman mailing lists.
  • A positive integer.
  • 0, unlimited, or null — The account can create unlimited mailing lists.
This value defaults to unlimited.
0
maxsub The account’s maximum number of subdomains.
  • A positive integer.
  • 0, unlimited, or null — The account can create unlimited subdomains.
This value defaults to unlimited.
0
hasshell Whether the account has shell (SSH) access.
  • y — The account has shell access.
  • n — The account does not have shell access.
This value defaults to the default package’s Shell Access value.
y
owner The root user or WHM reseller account that will own this account.
Important:
The authenticated user calling this script must have root privileges to assign the cPanel account owner to a reseller.
This value defaults to the authenticated user who runs the script.
root
plan The account’s hosting plan (package).
Important:
If you use this option, do not use the quota-related options in this script. Instead, we recommend that you allow the assigned plan determine quotas.
This value defaults to the default hosting plan.
default
maxpark The account’s maximum number of parked domains (aliases).
  • A positive integer.
  • unlimited — The account can use unlimited parked domains.
This value defaults to the selected package’s Maximum Parked Domains value.
unlimited
maxaddon The account’s maximum number of addon domains.
  • A positive integer.
  • 0 or unlimited — The account can use unlimited addon domains.
This value defaults to the selected package’s Maximum Addon Domains value.
unlimited
featurelist The account’s assigned feature list.

This value defaults to the selected package’s Feature List value.
default
contactemail The account’s contact email address.

This value defaults to an empty string value.
[email protected]
use_registered_nameservers Whether to use the domain’s registered nameservers instead of the server’s nameservers.
  • y — Use the domain’s nameservers.
  • n — Use the server’s nameservers.
This value defaults to n.
n
language The account’s locale, in two-letter ISO-3166-1 code format. This value is case-sensitive.
Note:
For region-specific locales, use the ISO 639-1 code, an underscore (_), and the ISO 3166-1 code.
This value defaults to the selected package’s Locale value.
EN
spamassassin Whether Apache SpamAssassin™ is enabled on the account.
  • y — Enable SpamAssassin.
  • n — Disable SpamAssassin.
This value defaults to y.
y
spambox Whether to enable spam box filtering on the account.
  • y — Enable spam box filtering.
  • n — Disable spam box filtering.
This value defaults to y.
Important:
You must enable Apache SpamAssassin if you use this option.
y
max_emailacct_quota The maximum email quota size, in megabytes (MB), that the account can define when it creates an email account.
  • A positive integer.
  • 0 or unlimited — The account has an unlimited quota.
This value defaults to the selected package’s Max Quota per Email Address (MB) value.
Important:
  • This value applies to each email account, not each cPanel account.
  • If you call this option, it overwrites the hosting plan's defined value for the account.
  • We recommend that you let the account's defined hosting plan determine this option's value.
unlimited

Additional Documentation