• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » How To Install WP CLI With apt get On Ubuntu Server?

By Abhishek Ghosh November 26, 2018 8:27 pm Updated on November 26, 2018

How To Install WP CLI With apt get On Ubuntu Server?

Advertisement

In previous articles we discussed about WP CLI. We used to avoid involving WP CLI as most of the new users with cloud, dedicated server may get confused on SSH. Many avoid WP CLI for multi-step CLI works. A Debian installer makes the installation, setup work just easy. This article will guide how to install WP CLI with apt get on Ubuntu server. This guide is usable on server with already running WordPress site as well as fresh server. Fresh blank servers need to install Apache2,  PHP 7.2 (latest commonly used at this moment), Percona MySQL.  WP CLI will :

  • Make WordPress works possible to perform with commands and bash scripts. Hence it is possible to automate more.
  • Make WordPress installation easy, avoiding wget, un-tar, moving files steps.

 

How To Install WP CLI With apt get

 

You will get official deb, rpm installer here on GitHub :

Vim
1
https://github.com/wp-cli/builds/tree/gh-pages/deb

You’ll get the apt version on Launchpad :

Advertisement

---

Vim
1
https://launchpad.net/~tiagohillebrandt/+archive/ubuntu/wp-cli

In order to install WP CLI, we will run :

Vim
1
2
3
4
5
sudo add-apt-repository ppa:tiagohillebrandt/wp-cli
## hit enter/return key to accept
apt update
apt upgrade
apt install wp-cli

How To Install WP CLI With apt get On Ubuntu Server

If you are root user, and run :

Vim
1
wp --help

You’ll get output like this :

Vim
1
2
3
4
5
6
7
8
9
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.
 
If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.
 
If you'd like to continue as root, please run this again, adding this flag:  --allow-root
 
If you'd like to run it as the user that this site is under, you can run the following to become the respective user:
 
    sudo -u USER -i -- wp <command>

You can run commands with :

Vim
1
wp --help --allow-root

If your current WordPress installation is at /var/www/html location, then change directory there :

Vim
1
cd /var/www/html

… then run test commands. If you have another WordPress site at /var/www/wordpress1 location, then you can individually manage it.

We can search WordPress plugin with keyword like SEO :

Vim
1
wp plugin search seo

Ideally, you should have an username with root privilage to install (or later manage) WordPress, keep the ownership of WordPress files to username:www-data. Commonly we use root:www-data for installation from SSH. You should take care that new plugins, themes are not getting installed with only root ownership – it can make PHP and WordPress unable to work properly. There is way to manage that, notice the commands :

Vim
1
2
3
4
5
6
7
# update wordpress
sudo -u www-data wp core update
sudo -u www-data wp core update-db
 
# install plugin
sudo -u www-data wp plugin install wordpress-seo
sudo -u www-data wp plugin activate wordpress-seo

To install WordPress in /var/www/htmlcurrent dir with database host localhost, with database name wordpress_db, database prefix wp_, database user abhishek, database password mypassword, Site
Name The Customize Windows, URL https://thecustomizewindows.com, WordPress account username thecustomizewindows, password loginpassword, email address admin@thecustomizewindows.com, command will be :

Vim
1
wp core download --path=/var/www/html && wp core config --dbhost=localhost --dbname=wordpress_db --dbprefix=wp_ --dbuser=abhishek --dbpass="mypassword" && wp db create && wp core install --url=https://thecustomizewindows.com --title="The Customize Windows" --admin_user=thecustomizewindows --admin_password="loginpassword" --admin_email=admin@thecustomizewindows.com

 

Conclusion

 

You can configure WP CLI more – perform database queries, manage user capabilities, manage cron events, import or export content to many works. There are huge resources for information on that topic :

Vim
1
2
3
4
5
6
# resources on wordpress
https://make.wordpress.org/cli/handbook/tools/
https://developer.wordpress.org/cli/commands/
 
# resources on wp-cli
http://wp-cli.org/

Tagged With apt install wp cli , apt-get install wp-cli

This Article Has Been Shared 313 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How To Install WP CLI With apt get On Ubuntu Server?

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Install Apache Drill on Ubuntu 16.04 LTS Single Cloud Server

    Drill is SQL Query Engine for Hadoop, NoSQL, Cloud Storage. Here is How to Install Apache Drill on Ubuntu 16.04 LTS Single Cloud Server.

  • Accessing Bluemix MySQL Database From External Server

    Here is How You’ll Be Accessing Bluemix MySQL Database From External Server With Root Access. On CLI You Need MySQL Client to Work on MySQL.

  • Ondřej Surý’s PPA For Ubuntu 18.04 LTS LAMP, LEMP : Current Status

    Before Upgrade, We Need to Check Resources, Incompatibilities and Needed Changes in Settings. Here is Current Status of Ondřej Surý’s PPA For Ubuntu 18.04 LTS For Setup of LAMP, LEMP Server.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Arduino : Independently Blink Multiple LED January 18, 2021
  • What is a Loosely Coupled System? January 17, 2021
  • How To Repack Installed Software on Debian/Ubuntu January 16, 2021
  • Components of Agile Software Development January 15, 2021
  • What is Conway’s Law? January 14, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "How To Install WP CLI With apt get On Ubuntu Server?," in The Customize Windows, November 26, 2018, January 19, 2021, https://thecustomizewindows.com/2018/11/how-to-install-wp-cli-with-apt-get-on-ubuntu-server/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy