• 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 910 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023
  • Simple Windows Security and Privacy Checklist for 2023 March 24, 2023
  • 7 Best Artificial Intelligence (AI) Software March 24, 2023
  • ESP32 Arduino Water Tank Level Monitoring Using Laser ToF Sensor March 23, 2023
  • Exploring the Benefits and Advantages of Microsoft’s Operating System March 22, 2023

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, March 25, 2023, https://thecustomizewindows.com/2018/11/how-to-install-wp-cli-with-apt-get-on-ubuntu-server/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT