Matomo Analytics

WordPress CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a web browser.

Installing WordPress CLI in your Ubuntu server isn't that hard.

Start by downloading the script:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

To check everything is working run the following command:

php wp-cli.phar --info

To make the command globally available we'll have to move the .phar script to the /usr/local/bin folder.

Run the following commands to make this available:

chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

Now you can run this command anywhere you are in the server:

wp --info

Updating the CLI

Run the following command to update the CLI script:

wp cli update

Or run the installation script again, this will also update you to the latest version.

15 May 2021 (last updated 2 years ago)

3576 views

Written by Dennis Smink

Dennis brings over 6 years of hands-on experience in server management, specializing in optimizing web services for scalability and security.

Back to Server


Start free trial