This page describes how to install wp-cli in a cPanel/WHM server with CloudLinux, of course our cPanel comes with wp-cli preinstalled. This page should be used by system admins who want to make wp-cli available to their customers in cPanel with CloudLinux/CageFS installed. First, SSH to the cPanel/WHM server as the root user. Next, run these commands to install wp-cli:

cd curl -O chmod +x wp-cli.phar mv wp-cli.phar /usr/local/bin/wp

Now, as you have installed wp-cli, let’s add it to the CageFS so that users could access it

vim /etc/cagefs/conf.d/wpcli.cfg

And add this content:

[wpcli] comment=Allow wp-cli to work on the server paths=/usr/local/bin/wp

Next, update CageFS

cagefsctl --force-update

Test to see if it works, become a CageFS user.

su cagefsuser wp --info

Did this answer your question?