• 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 » WP-CLI and Cloud Server

By Abhishek Ghosh July 7, 2014 5:55 pm Updated on July 7, 2014

WP-CLI and Cloud Server

Advertisement

With Cloud Automation, we can integrate WP-CLI, a command line tool for WordPress for better, easy and faster management on Cloud Server. As we have discussed before, there is huge change in Automation in the Cloud in recent time. Software defined, Bare Metal hosting with the flexibilities of a typical cloud IaaS are emerging now. Chef Software is rocking on OpenStack Cloud Software for IaaS and OpenShift PaaS. Providers like Rackspace has blueprints which uses WP-CLI for their Rackspace Deployments product. We talked about WordPress Command Line Tool before, the tool is same but we are elaborating something more.

 

WP-CLI and Cloud Server

 

For using WP-CLI on Cloud Server (we are assuming that you are using latest LTS version of Ubuntu on OpenStack Cloud, i.e. Ubuntu 14.04 at the time of publication of this article), you need to have a minimum knowledge on bash profile. You can read articles like Can Not Find .Profile File OS X, Change $PATH Variable on OS X for minimum idea on profiles on UNIX or UNIX Like Operating Systems / Linux. There will be not much difference in commands between OS X and Ubuntu except some Philosophical matters like Wheel Group, file permissions, source code etc. The reason to point to these articles is that; we will create a .bash_profile file for our root user and add the path to the wp-cli executable. The source code of WP-CLI is available here :

Vim
1
https://github.com/wp-cli/wp-cli

We can cURL the bash script from raw github :

Advertisement

---

Vim
1
https://raw.githubusercontent.com/wp-cli/wp-cli.github.com/master/installer.sh

Also, chef cookbook is available for wp-cli :

Vim
1
https://github.com/francescolaffi/chef-wp-cli

In this article WP-CLI and Cloud Server, we will discuss about the traditional WP-CLI, not the chef cookbook wp-cli.
WP-CLI and Cloud Server

 

WP-CLI and Cloud Server : Getting Started Guide

 

This is a bit complicated setup and demands minimum working experience with UNIX systems, if you are a new user; you should follow the plain one server WordPress Setup guide on Ubuntu. We will not need to do the steps like :

Vim
1
2
3
4
~  cd /var/www/html && rm index.html
# download wordpress
~  wget http://wordpress.org/latest.tar.gz
[...]

So, let us get started with WP-CLI installation. First, we will cURL the bash script to install wp-cli :

We should install git first, just a customary update and installing git after you SSH to the server instance as root :

Vim
1
apt-get update && apt-get install git

We will install wp-cli with two commands :

Vim
1
2
3
4
5
6
curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh && installer.sh bash
# one can avoid && and use fully two separate commands
curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh
installer.sh bash
# technically it should work with one command
curl https://raw.githubusercontent.com/wp-cli/wp-cli.github.com/master/installer.sh | bash

As we said, we need to work with bash profile :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
nano ~/.bash_profile
# add these lines
export PATH=/root/.wp-cli/bin:$PATH
source $HOME/.wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash
alias wp="wp --allow-root"
# do not add these lines. Try
# ' instead of "
# alias wp='wp --allow-root'
# Typography and keyboard mapping can change
# what we typed / wanted to show depending on OS
# save the file
# ^ + O writes, ^ + X exits

The third line; alias wp="wp --allow-root" is optional and to avoid specifying " --allow-root" while using wp as command by root user. You can read Create Aliases on OS X and Linux for Faster Work on Command Line for explanation. You can read more on alias part :

Vim
1
http://ss64.com/bash/alias.html

We should load the environment :

Vim
1
source ~/.bash_profile

You should work here :

Vim
1
cd /home/wordpress/public_html

You can install wordpress with this command :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
wp core install --url="edit_domain_name"  --title="Edit Blog Title" --admin_user="edit_admin" --admin_password="put_password" --admin_email="edit_email"
# output
# Success: WordPress installed successfully.
# kind on manual
wp help
# get list of posts
wp post list
# output
+----+--------------+-------------+---------------------+-------------+
| ID | post_title   | post_name   | post_date           | post_status |
+----+--------------+-------------+---------------------+-------------+
| 1  | Hello world! | hello-world | 2014-06-07 21:02:09 | publish     |
+----+--------------+-------------+---------------------+-------------+

Yes, we can run database related commands too :

Vim
1
2
3
4
5
6
7
wp db query "SELECT user_login,ID FROM wp_users;"
# output
+------------+----+
| user_login | ID |
+------------+----+
| admin      |  1 |
+------------+----+

It is not our work to copy paste the example usages :

Vim
1
2
http://wp-cli.org/commands/
https://github.com/wp-cli/wp-cli/wiki/Community-Packages

That is all about WP-CLI we wanted to tell you. For Rackspace Deployment, the wp-cli is programmatically deleted. They probably use Checkmate and OpenStack Heat, more complex, easy for the end user :

Vim
1
https://github.com/rackspace-orchestration-templates/wordpress-single

Tagged With ZDPP , RWZQ , PMPG , K9PV , GS1O , FAI7 , DGAN , 7C38 , 5TKD , 4VKL

This Article Has Been Shared 730 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 WP-CLI and Cloud Server

  • Cloud Computing Categories : Cloud Computing in Layman’s Terms

    Cloud Computing Categories is purely based on the understanding of Cloud Computing in Layman’s Terms and does not follow the definitions and standards by NIST.

  • Cloud Computing vs Traditional Computing

    Cloud Computing vs Traditional Computing is the one of the topic most new users wants to know about. The basic reason to compare is to understand Cloud itself.

  • Cloud Computing XaaS : Approaches and Possibilities

    Cloud Computing XaaS is an approach towards everything to provide as a service to make available and consume like we use electricity.Read the important aspects.

  • Hybrid Cloud is the Future Not Public Cloud

    Hybrid Cloud is the Future Not Public Cloud, Because Control and Privacy of Data Becoming a Major Concern to the Corporate Sector and Medium Sized Companies.

  • Relationship of Geographic Location of Data Centers and Network Latency

    Relationship of geographic location of Data Centers and network latency is always one of the features which is taken into account while operating in different countries.

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

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "WP-CLI and Cloud Server," in The Customize Windows, July 7, 2014, February 1, 2023, https://thecustomizewindows.com/2014/07/wp-cli-cloud-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