WP-CLI » Install WP-CLI on cPanel shared hosting

Install WP-CLI on cPanel shared hosting

If you have root-level access to the server you can follow this guide to install WP CLI on your WHM/cPanel server: https://blog.cpanel.com/wp-cli-install-and-manage-wordpress-on-the-command-line/

If you don’t have access to the root account nor can run sudo, but still have a user/level access to the terminal like from the cPanel terminal let’s say, then you can still install and use wp-cli.

cd /home/USERNAME/public_html/
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar

and then use the full path to the wp-cli.phar file:

/home/USERNAME/public_html/wp-cli.phar config list

Where:

  • USERNAME – is your cPanel username
  • /home/USERNAME/public_html/ – is the path to your WordPress installation
  • config list – is an example command for WP-CLI
See also  Most useful WP-CLI commands with examples + how to fix most common WPCLI errors

Was this post helpful?

1 thought on “Install WP-CLI on cPanel shared hosting”

  1. It worked on a cPanel shared hosting without root nor sudo access, but before “/home/USERNAME/public_html/wp-cli.phar config list” line, it was needed to run “chmod +x wp-cli.phar”. Thanks for sharing WP-CLI knowledge.

    Reply

Leave a Comment

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

Recommended