Local Bedrock is a site boilerplate for Local by Flywheel to quickly create a new site with Roots.io Bedrock WordPress installation.
Those instructions are tested with the latest stable Local by Flywheel version and the latest Local Environment. As time of writing those are 3.0.2 and 1.3.1 respectively.
git clone --depth=1 https://github.com/artifex404/local-bedrock && rm -rf local-bedrock/.git local-bedrock/README.md local-bedrock/.gitignore
cd local-bedrock && zip -r ../local-bedrock.zip . * && cd ..
- If you're on mac, you can use
open .
to open the current folder in Finder. - Drag and drop
local-bedrock.zip
to the Local by Flywheel application window. - Enter details for your new site. Make sure to select a Custom environment along with Nginx.
- Proceed with the import. If the import gets stuck. Select Restart Local Machine from the Help menu and proceed with the next steps after the restart.
- Update
WP_HOME
variable inapp/public/.env
of the newly created site path. Enter the selected domain in the step 5. - Generate new site salts from https://roots.io/salts.html and replace the existing ones in
app/public/.env
. - Click the right mouse on the newly created site entry in Local by Flywheel and select Open Site SSH.
- Copy and paste the following command to the opened terminal and press enter:
sed "s/root \/app\/public\/\;/root \/app\/public\/web\/\;/g" /etc/nginx/wordpress/site.conf | tee /tmp/site.conf && mv /tmp/site.conf /etc/nginx/wordpress/site.conf
- Copy and paste the following command too to fix the WP-CLI path:
sed "s/\/app\/public/\/app\/public\/web/g" /wp-cli.yml | tee /wp-cli.yml
- Restart the newly created site by clicking first the green dot near the newly created site to stop. Once stopped click the gray dot to start the site again.
Now you have a fully working WordPress Bedrock site on Local by Flywheel.
Before you go on developing the site, save the newly created website as a blueprint.
- Right click on the site name you just created.
- Select
Save as Blueprint
. - Click
Save Blueprint
button.
Now whenever you need a clean Bedrock WordPress site, you can just select the saved blueprint from the Advanced Options
on the new site creation screen in Local by Flywheel.
This site installation creates an WordPress administrator user with the following credentials:
User: local-bedrock
Password: local-bedrock
If during the site import you chose another domain than the original local-bedrock.test
, a few places in the database will still have the old domain.
The items still having the old domain are: wp_posts
sample posts guid, and wp_options
siteurl and home variables.
It is not crucial to change the siteurl and home variables values in the database, since the .env configuration file override them.
However, if you want to clean up the old domain name:
- Right click on the site name in Local by Flywheel on the left sidebar, and select
Open Site SSH
- In the opened terminal write, make sure to replace XXXXX by your newly chosen domain:
cd /app/public && wp search-replace local-bedrock.test XXXXX --all-tables