Title: wp cli permissions
Last modified: December 28, 2023

---

# wp cli permissions

 *  [Richard Gates](https://wordpress.org/support/users/richardkentgates/)
 * (@richardkentgates)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-permissions/)
 * I am trying to figure out the permissions to get wp cli working on a Google Cloud
   VM with Ubuntu 22.04 php8.1. I followed the official documentation at [https://make.wordpress.org/cli/handbook/](https://make.wordpress.org/cli/handbook/)
   which got the cli running but not with write permissions. Execute and read were
   fine. Here are the only things I got from researching. You can use root but that
   is not good for security reasons, and it cannot write to its own cache under 
   root. You can create a group with apache and the current user with the current
   user being owner and grant wxr to the group. You can run commands under sudo -
   u www-data (apache). I’m not as proficient at some of this as a lot of you but
   none of that seems normal or production safe. I really really want to get this
   up so I can begin learning it.
 * wp info output [https://paste.gnome.org/RMjEypZZJ](https://paste.gnome.org/RMjEypZZJ)
    -  This topic was modified 2 years, 3 months ago by [Richard Gates](https://wordpress.org/support/users/richardkentgates/).
    -  This topic was modified 2 years, 3 months ago by [Richard Gates](https://wordpress.org/support/users/richardkentgates/).
    -  This topic was modified 2 years, 3 months ago by [Richard Gates](https://wordpress.org/support/users/richardkentgates/).
      Reason: Removed un-needed content

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-permissions/#post-17308286)
 * With which authorizations wp cli runs always depends strongly on the local system.
   Depending on how you have designed it, different things are necessary.
 * However, the recommendation is to always run wp cli with the user that is used
   for the specific Vhost. In your case, this appears to be apache. This is therefore
   also the way you should go. I also work this way.
 *  [Svetoslav Marinov](https://wordpress.org/support/users/lordspace/)
 * (@lordspace)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/wp-cli-permissions/#post-17346620)
 * [@richardkentgates](https://wordpress.org/support/users/richardkentgates/) the
   wp info output is not available anymore. Normally you need permissions 0755 and
   install the .phar file as /usr/local/bin/wp.
   then you need to switch to a given
   OS account e.g. su your_site_userthen you can safely run commands such wp plugin
   list

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp cli permissions’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 2 replies
 * 3 participants
 * Last reply from: [Svetoslav Marinov](https://wordpress.org/support/users/lordspace/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/wp-cli-permissions/#post-17346620)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
