Easy WordPress Bootstrap
Easily set up a new WordPress dev environment utilizing Laravel Herd and DBngin (or other MySQL/MariaDB solutions).
One command to spin up a new WordPress project locally:
- Creates a project folder in your Herd workspace
- Provisions MySQL DB + user via DBngin or other MySQL/MariaDB solution.
- Generates wp-config.php with salts
- Installs WP and sets default options (Home/News, other useful pages, permalinks)
- Installs/activates plugins from
plugins.json - Clones theme starter (with fresh history), activates it, and initializes a clean repo
Prerequisites
- macOS, Linux, or Windows
- Herd installed and a workspace directory (default:
~/Herd) - DBngin or other MySQL/MariaDB server
- CLI tools in PATH:
wp,git,curl,openssl,mysql, and optionallyjq
Quick Start
-
Copy
wp-bootstraprc.exampleto~/.wp-bootstraprcand edit values (one-time setup):cp wp-bootstraprc.example ~/.wp-bootstraprc -
(Optional) Edit
plugins.json. -
Run the bootstrap:
chmod +x wp-bootstrap.sh ./wp-bootstrap.sh -
Answer prompts. When finished, the script prints a summary and writes
bootstrap-summary.txt.
Configuration
- Herd workspace: set
HERD_WORKSPACEin~/.wp-bootstraprc. - Local TLD: set
LOCAL_TLD(testby default). - DBngin: set
MYSQL_HOST,MYSQL_PORT,MYSQL_ROOT_USER,MYSQL_ROOT_PASS. - Theme starter: set
THEME_STARTER_REPO. The script clones shallow, removes.git, then re-initializes the theme repo. - Theme remote: set
DEFAULT_THEME_REMOTE_ORIGINif you want the script to push the new theme repo automatically.
Plugins
Baseline plugins are defined in plugins.json. Each entry accepts either a WordPress.org slug or a direct zip URL.
Premium/private zips: use signed/internal URLs or manually download and point to a local
/tmp/file.zip(adjust the script towp plugin install /tmp/file.zip).
Notes
- The script sets friendly permalinks (
/%postname%/) and creates Home/News pages by default. - Sample content is removed if present.
- A plugin install log is written to
wp-content/plugin-bootstrap.log.
Troubleshooting
- If
wpis not found, ensure WP-CLI is installed and available inPATH. - If MySQL connection fails, confirm DBngin is running and credentials are correct in
~/.wp-bootstraprc. - On Windows, prefer WSL or Git Bash for best results.
--
DIY-first policy: keep plugins.json minimal. Add big off-the-shelf stacks (e.g., ecomm) only when warranted.