Need a Quick WooCommerce Site WP CLI to the Rescue
Why CLI-Driven WordPress Workflow Beats Manual Setup
When clients ask for a fast way to order marketing materials or simple e commerce products the manual WordPress setup process can slow everything down. I already had product data vendors SKUs and payment flows ready. What I needed was a repeatable method to build WooCommerce sites in minutes instead of hours.
That is where WP CLI becomes essential. Using only the terminal you can deploy WordPress configure your database install WooCommerce activate a theme and prepare your store for products without touching a GUI.
Why WP CLI Is the Fastest Way to Deploy WooCommerce
WP CLI provides a programmatic interface for managing WordPress. It delivers:
- Extremely fast setup
- Repeatable scriptable installs
- Full CLI environment with no GUI needed
- Perfect for agencies deploying WooCommerce frequently
If you want a consistent automated WooCommerce installation workflow WP CLI is the tool of choice.
Server Requirements for a CLI Only Setup
Before starting make sure you have:
- SSH access
- MySQL or MariaDB
- PHP and Apache or Nginx
- WP CLI installed
- A database privileged user
You can install WP CLI using instructions at https://wp-cli.org
Step 1 SSH Into Your Server
ssh username@yourserver.com
cd /var/www/
mkdir example-store
cd example-store
Step 2 Create the MySQL Database
mysql -u root -p -e "
CREATE DATABASE storedb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'storeuser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON storedb.* TO 'storeuser'@'localhost';
FLUSH PRIVILEGES;
"
Step 3 Download WordPress with WP CLI
wp core download
Step 4 Generate wp config php
wp config create
--dbname=storedb
--dbuser=storeuser
--dbpass=strongpassword
--dbhost=localhost
--dbprefix=wp_
Step 5 Install WordPress Automatically
wp core install
--url="https://example.com"
--title="Example Store"
--admin_user="admin"
--admin_password="supersecret"
--admin_email="info@example.com"
Step 6 Install and Activate a WooCommerce Theme
wp theme install flash --activate
Step 7 Install Required Plugins
wp plugin install woocommerce --activate
Optional extras:
wp plugin install siteorigin-panels jetpack --activate
Step 8 Create Custom User Roles Optional
wp role create acmeclient "ACME Client"
Step 9 Flush Rewrite Rules
wp rewrite flush --hard
Step 10 Single Site Quickstart Script
# WooCommerce Quickstart Script
PROJECT_DIR="/var/www/example-store"
DB_NAME="storedb"
DB_USER="storeuser"
DB_PASS="strongpassword"
DB_HOST="localhost"
SITE_URL="https://example.com"
SITE_TITLE="Example Store"
ADMIN_USER="admin"
ADMIN_PASS="supersecret"
ADMIN_EMAIL="info@example.com"
mkdir -p "$PROJECT_DIR"
cd "$PROJECT_DIR"
wp core download
mysql -u root -p -e "
CREATE DATABASE IF NOT EXISTS ${DB_NAME};
CREATE USER IF NOT EXISTS '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}';
GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'localhost';
FLUSH PRIVILEGES;
"
wp config create --dbname="$DB_NAME" --dbuser="$DB_USER" --dbpass="$DB_PASS" --dbhost="$DB_HOST"
wp core install
--url="$SITE_URL"
--title="$SITE_TITLE"
--admin_user="$ADMIN_USER"
--admin_password="$ADMIN_PASS"
--admin_email="$ADMIN_EMAIL"
wp theme install flash --activate
wp plugin install woocommerce --activate
wp rewrite flush --hard
Reusable Deployment Script
A full reusable script is included in the original post and can be adapted for agencies or frequent setups.
Final Thoughts and Next Steps
If you build WordPress or WooCommerce sites often WP CLI turns setup into an automated predictable workflow. You can version scripts share them with your team and deploy client sites quickly and consistently.
You can explore the full WP CLI command reference at: https://developer.wordpress.org/cli/commands/
Want Help Automating Your WordPress or WooCommerce Workflow
If you want a repeatable deployment workflow automated CLI tools or a custom WooCommerce starter stack I can help.
Want to see how a custom WP CLI automation build saves time for your build
Request Build Support