WP-CLI » Install WP-CLI in cPanel with CageFS

Install WP-CLI in cPanel with CageFS

In this guide, I talked about adding WP-CLI to your system, but if you use cPanel with CloudLinux, you also need to include it in CageFS so that all users can access the wp command.

First, download the WP-CLI command inside /usr/local/bin

cd /usr/local/bin
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
mv wp-cli.phar wp
chmod +x wp

Add WP-CLI path to CageFS:

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

and inside add:

[wpcli]
comment=Allow wp-cli to work on the server
paths=/usr/local/bin/wp
image 12 - Install WP-CLI in cPanel with CageFS

save the file, then update CageFS to include the change:

cagefsctl --force-update
image 11 - Install WP-CLI in cPanel with CageFS
See also  Setup tab completions for WP-CLI

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended