ValetPress allows for the quick installation and configuration of WordPress install for local development and testing. The idea of this script was inspired from the script that @AaronRutley originally created (https://github.com/AaronRutley/valetpress), but has been written from the ground up to provide cleaner code, as well as adding/removing features that I felt were or were not necessary for my daily usage.
The script itself uses Laravel Valet and WP-CLI to speed up the creation of a WordPress install on your local system. Before @AaronRutley demoed his script to me I was using MAMP, and/or manually setting up installs on my computer which was far more time consuming than his script was.
While the original script works great… I got bored and decided to rewrite it for my own needs.
- Create a fresh WordPress site in a few seconds
- Download, Install and activate WordPress
- Auto login to the new WordPress install
- Easily delete the WordPress install(s)
- Setup Laravel Valet / MySQL Instructions
- Download / Clone this repo into a directory such as
- Include the
vpscript in your
- A Brewfile is included to help with the dependancies that are needed.
- Update the
config.jsonfile to reflect your needed settings. (see the 'Config Explained' section below)
- Download WordPress into a directory like
~/Sites/myprojectas specified in the config.json
- Setup the database called
myproject& configure the install
- Create a user
adminwith the password
myproject.testrunning in just a few seconds
- Lists all ValetPress installations
- Will ask for the name of the project you would like to delete
- Ask you to confim that you wish to delete the project
- Deletes the database for that project
- Deletes the directory for that project
- Will display a summary of available commands
wp_admin_emailis used as the admin email address for new WP installs.
wp_admin_useris used as the username for new WP installs. If changed you must update the username in the auto-login plugin
wp_admin_passwordis used as the password for new WP installs. If changed you must update the password in the auto-login plugin
sites_folderis a directory that you've run
valet parkin to serve sites.
open_browserif set to
1a browser will auto open after the install completes,
0will make so that it doesn't
browseryou can set the default browser such as Safari, or Google Chrome, etc
valet_domainDefault is set to
testbut you can change this to whatever you use for Valet, this can be adjusted by using
valet domain TLDTOUSE
plugins_addPlugins that you wish to install/activate on each new install
plugins_removePlugins that you wish to remove from the default installs
Below you will find a list of all required system files in order for ValetPress to proper work.
- Valet - With out this sites will not load
- MySQL or MariaDB - Needed for WordPress
- Homebrew - Used for installing MySQL/PHP/etc
- jq - Used for reading the config file
- WP-CLI - Needed to complete WordPress installs.
Note: You will need to add the ValetPress directory to your $PATH in your
.zshrc so that you can run the
vp command from anywhere on your computer.