Bedrock on Local can't correctly set up root

Issue Summary

I’ve been trying to set up a Bedrock local app with this tutorial Better WordPress Environment and Workflow with Bedrock and Local by Flywheel - YouTube and this one (2021) How to install Bedrock by Roots.io on Local Machine - YouTube.

I have no issues with using Composer to install the project, and I’ve set up my .env as so (with salts):

DB_NAME=‘local’
DB_USER=‘root’
DB_PASSWORD=‘root’
WP_ENV=‘development’
WP_HOME=‘http://bedrock.local/
WP_SITEURL=“${WP_HOME}/wp”
WP_DEBUG_LOG=/path/to/debug.log

I’ve then set up my conf/nginx/site.conf.hbs file root to this:
root "/Users/myusername/Local Sites/bedrock/app/bedrock/web"

When I delete my public folder, restart my Local and try to run my app locally, I get a 502 on bedrock.local, bedrock.local/wp/wp-admin, and my Database tab in Local shows this:

note: the Local site worked before I deleted the public folder

I think I’ve followed these same steps about 20 times today and I just can’t figure it out!

I’ve also been scouring the Local community posts and nothing seems to be working.

System Details

Local version: 5.1.4+5377
OS: macOS Mojave 10.14.6

Log attached here local.log (8.8 KB)

I use LocalWP with Bedrock configuration all the time. Here are my tips:

Move all of the contents of your bedrock project directly into the app folder. You can leave the /public folder there, but delete all of its contents (this just makes it play nice with the local site shell as it will look for this directory). If you’re using git, add /public and /sql to your .gitignore file.

Then, set your conf/nginx/site.conf.hbs file to:
root "/Users/myusername/Local Sites/bedrock/app/web/"

Your Database tab will look like it does in your screenshot, but it will function fine. If it really bothers you, you can add a dummy wp-config.php file with those defaults in the /public folder. This serves no actual function for WordPress, but it allows Local WP to detect it.

If you get a warning that the Site URL / Home URL don’t match, I usually just manually change them in the database using Adminer because WP will use the .env file for those variables anyways. Set them both to your URL (ie. https://bedrock.local) without the /wp for the Site URL.

Hope this helps!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.