How to Increase Disk Quota for a cPanel Account via CLI?

  Uncategorized

Introduction:

Disk quotas in cPanel allow administrators to control the amount of disk space allocated to individual hosting accounts. As websites grow, users may require additional storage for files, emails, databases, and backups. cPanel provides a command-line interface (CLI) that enables administrators to quickly modify disk quotas without accessing the WHM graphical interface.

This article explains how to increase the disk quota for a cPanel account using the command line.

Prerequisites

Before proceeding, ensure that the following requirements are met:

  • Root SSH access to the server.
  • cPanel & WHM installed on the server.
  • Knowledge of the cPanel account username.
  • Disk quotas enabled on the server.
  • Sufficient available disk space.

Implementation

Step 1:

Log in to the server via SSH as the root user:

$ ssh root@server_ip

Step 2:

To view the current disk quota assigned to a cPanel account, execute:

$ whmapi1 accountsummary user=username

Replace username with the actual cPanel account username.

Step 3:

To set the disk quota to 20 GB (20480 MB), run:

$ whmapi1 editquota user=username quota=20480

Example:

$ whmapi1 editquota user=testuser quota=20480

Note: The quota value is specified in megabytes (MB). For example, 10 GB = 10240 MB and 50 GB = 51200 MB.

Step 4: Set Unlimited Disk Quota (Optional)

To assign unlimited disk space to an account, execute:

$ whmapi1 editquota user=username quota=0

Example:

$ whmapi1 editquota user=testuser quota=0

Step 5: Verify the Updated Quota

Run the following command to confirm the changes:

$ whmapi1 accountsummary user=username

Example:

$ whmapi1 accountsummary user=testuser

The output should display the updated disk quota.

Conclusion

Managing disk quotas through the command line provides a quick and efficient way to allocate additional storage to cPanel accounts. Using the whmapi1 editquota command, administrators can easily increase, decrease, or set unlimited quotas without accessing the WHM interface.

LEAVE A COMMENT