This article provides a guide for how to install and enable WP-CLI on cPanel WHM server. This guide is intended for root-level cPanel VPS or cPanel Dedicated Server administrators.
What is WP-CLI?
WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a web browser.
Install WP-CLI on cPanel WHM Server
To install and enable WP-CLI on cPanel/WHM server, perform the following steps.
- SSH the server as root user
- Run the following command to install the WP-CLI packages from Github:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- Execute permissions with:
chmod +x wp-cli.phar
- Allow every user to run WP-CLI by moving it to a directory in the system’s PATH:
mv wp-cli.phar /usr/local/bin/wp
Conclusion
You have now installed WP-CLI on cPanel WHM server. If you face any difficulties, please open a support ticket for assistance.