Installing WordPress

Using Flex Clouds for when WP is Required

There are two ways to install WordPress in a Flex Cloud. The Traditional Way gets you a very basic WordPress installation. The recommended way installs Composer and wp-cli, a command line tool that makes setting up WordPress correctly with common and recommended plug-ins more convenient.

Friendly URLs for WordPress should work out of the box in MODX Cloud, but you may need to edit your nginx web rules depending on where you wish it installed. See examples 14 and 15 on our Web Rules user guide page.

Use wp-cli for Added Options

Installing via wp-cli lets you do many things WP-related when logged into the command line:

  1. Create a new Flex Cloud instance for your WordPress site. Make note of the internal Cloud URL, which looks something like cNNN.paas1.tx.modxcloud.com. You will also need the database credentials in the steps below.

  2. After your Cloud has been created, open your terminal, shell or Putty to login via ssh into your new Flex Cloud instance and change directories into your web root:

    cd www
  3. Download and install wp-cli (you’ll get Composer, too):

    curl http://modx.co/scripts/install.sh | sh
    
  4. Install WP via wp-cli into a subfolder of webroot called /wp, modifying the relevant instance, paths and connection details, as appropriate. To install into webroot, the paths would be only "/www":

    wp core download --path="/www/wp"
    
    wp core config --dbhost=127.0.0.1 --dbname=instance_c9999_flex --dbuser=c9999 --dbpass=xxxxxxxxxx --dbprefix=wp_ --path="/www/wp"
    
    wp core install --path="/www/wp" --title="Hello WP!" --admin_user="your-username" --admin_password="please-put-something-secure-here" --admin_email="you@example.com" --url="https://c9999.paas1.abc.modxcloud.com/wp"
    
  5. You further use wp-cli to install caching and SEO plugins that most WP sites should use, like W3 Total Cache, Yoast SEO, Login Lockdown, WP Mail SMTP (so you can use an ESP for better email deliverability) and Export Plus (for easier migrations to Revo!):

    wp plugin install w3-total-cache
    wp plugin install wordpress-seo
    wp plugin install login-lockdown
    wp plugin install wp-mail-smtp
    wp plugin install export-plus
  6. You can also use wp-cli to add admin users to your installation:

    wp user create username users@email.com --role=administrator
    

The Traditional Way

Alternately, you can install WordPress the old fashioned way.

  1. First, ssh into your Flex Cloud instance and grab WP from the source:

    cd www
    curl -J -L https://wordpress.org/latest.tar.gz -o ./wp.tar.gz
    
  2. To install into webroot:

    tar zxvf wp.tar.gz -C ./

    Alternately, to install into /wp:

    tar zxvf wp.tar.gz
    cd wp
    
  3. Setup the WordPress config file:

    mv wp-config-sample.php wp-config.php
    nano wp-config.php
    
  4. Fill in your database credentials from your Cloud Dashboard et viola!

  5. Visit your web root to complete the WP installation.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.