Skip to content

Instantly share code, notes, and snippets.

@jeffpamer
Forked from orumad/wordpress-valet-install.md
Created September 19, 2017 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpamer/32ec3fca3e33dfc2e2a89e6156ad483c to your computer and use it in GitHub Desktop.
Save jeffpamer/32ec3fca3e33dfc2e2a89e6156ad483c to your computer and use it in GitHub Desktop.
How to install Wordpress from command line in Valet

How to install Wordpress from command line in Valet

I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)

This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.

Install 'WP-CLI' command line tool

If you don't have installed 'WP-CLI' tool yet, it can be done (in macOS) with:

$ brew install wp-cli

Install Wordpress

First we must to create a new project folder, download Wordpress and uncompress it... with this single command:

$ wp core download --path=MyWordpress

Now we can cding into our MyWordpress new folder and we can see all the Wordpress stuff right here!

$ cd MyWordpress
$ ls
index.php            wp-admin             wp-config.php        wp-links-opml.php    wp-settings.php
license.txt          wp-blog-header.php   wp-content           wp-load.php          wp-signup.php
readme.html          wp-comments-post.php wp-cron.php          wp-login.php         wp-trackback.php
wp-activate.php      wp-config-sample.php wp-includes          wp-mail.php          xmlrpc.php

It's time to setup our database info. As I said above, I'm using Valet, so I setup my user as root and no password:

$ wp core config --dbname=mywordpress --dbuser=root

Next we will create the database:

$ wp db create

And finally we will make the 'famous five minutes Wordpress install' using:

$ wp core install --url=http://mywordpress.app --title="My Wordpress Site" --admin_user=superadmin --admin_password=supersecret --admin_email=me@mydomain.com --skip-email

That is!

BONUS: Install WooCommerce

$ wp plugin install woocommerce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment