# Local Bedrock Development with Local by Flywheel

**URL:** https://discourse.roots.io/t/local-bedrock-development-with-local-by-flywheel/14535
**Category:** bedrock
**Tags:** guide
**Created:** 2019-01-08T20:32:51Z
**Posts:** 26

## Post 1 by @JulienMelissas — 2019-01-08T20:32:51Z

Originally published at: [https://roots.io/guides/local-bedrock-development-with-local-by-flywheel/](https://roots.io/guides/local-bedrock-development-with-local-by-flywheel/)  
   
While there are many fantastic tools for developing with WordPress (and other things) locally, I’ve found that some developers might be a little bit weary to use the command line at all times. Personally, I love GUIs and find them to be a little easier to use as long as they can be lightweight. Local…

---

## Post 2 by @henscu — 2019-01-14T20:22:52Z

@JulienMelissas, thanks a lot - very clear info - I hacked about with Docker from scratch for ages, but could never get SSL to work…

Do you find your Flywheel site is more responsive/faster than Vagrant?

How did you decide on Flywheel BTW? Did you consider [Devilbox](http://devilbox.org/) for example?

Sounds like it would be fairly simple to migrate an existing site from local Trellis/Vagrant to this setup, or are there any gotchas?

---

## Post 3 by @JulienMelissas — 2019-01-14T20:41:29Z

> Do you find your Flywheel site is more responsive/faster than Vagrant?

I moved off of Vagrant a long time ago. WAYYYY too slow.

> How did you decide on Flywheel BTW? Did you consider [Devilbox](http://devilbox.org/) for example?

I decided on Flywheel because it looked easy to use, I tried it, and it worked quickly for me and my other devs. No other big reason. I like that it’s well supported in the WP world. Lando looks cool too.

> Sounds like it would be fairly simple to migrate an existing site from local Trellis/Vagrant to this setup, or are there any gotchas?

I don’t think it would be difficult to migrate from existing Trellis / Vagrant setup. Make a new site, follow my instructions or just clone the existing Bedrock repo in in place of my `composer create-project` command, and move the DB and you should be fine.

EDIT: it should take you less than an hour to try it out. I’d suggest just trying it and seeing how you like it. I’d also suggest checking out Lando: [Dockerize Local Bedrock & Sage Development with Lando - guides - Roots Discourse](https://roots.io/guides/dockerize-local-bedrock-and-sage-development-with-lando/)

---

## Post 4 by @anthon — 2019-02-07T23:59:39Z

This is awesome- thanks for putting it together.

I’ve tried today with a new install of everything (Local is now v3.0.4) and unfortunately it doesn’t seem to work. Based on the logs from Local (below) I am guessing this is why:

```
Feb 7, 2019, 5:21 PM PST - warn: [main/SiteModel] wpInstalled not returning "installed" 
{ stdout: '',
  stderr:
   'Error: This does not seem to be a WordPress install.\nPass --path=`path/to/wordpress` or run `wp core download`.' }
```

---

## Post 5 by @anthon — 2019-02-08T01:51:00Z

Strangely- after leaving it for a few minutes, it worked? I had previously done a restart a couple of times as well.

---

## Post 6 by @JulienMelissas — 2019-02-08T05:20:39Z

Weird. Yeah I’ve never encountered that error, but glad you figured it out!

---

## Post 7 by @JulienMelissas — 2019-02-19T20:32:53Z

This topic was automatically closed after 42 days. New replies are no longer allowed.

---

## Post 8 by @JulienMelissas — 2020-12-04T17:39:32Z



---

## Post 9 by @JulienMelissas — 2020-12-04T17:41:30Z

Hey just as a quick update here - I’ll try and get the guide updated when I can, but if you are using the new version of Local (Lightning?), you may have to provide the full path to your webroot.

See this tweet: [https://twitter.com/julienmelissas/status/1263507722957398017?s=21](https://twitter.com/julienmelissas/status/1263507722957398017?s=21)

---

## Post 10 by @kmills — 2020-12-05T15:10:56Z

That worked for me, thank you!!

---

## Post 11 by @Alfred_Smart — 2020-12-07T17:52:12Z

Seems this process works fine for linux and macOS users however, for windows its spitting out 404 error. The nginx file is named site.conf.hbs on local by flywheel and the root is pointing to root “{{root}}”; am i missing something?

---

## Post 12 by @JulienMelissas — 2020-12-07T21:48:53Z

Hey @Alfred_Smart - unfortunately I don’t have Windows so I can’t look for myself. I’d suggest reaching out to the Local by Flywheel folks and asking them about that! Sorry I can’t be more helpful.

---

## Post 13 by @csorrentino — 2020-12-09T20:09:54Z

@Alfred_Smart If you haven’t already done this, you need to print the full path for root instead of using {{root}}. I’m not sure what the windows equivalent is, but on a mac I would replace {{root}} with the output of `pwd` from the web directory.

Local has a discourse which might be another place to get help on this. [https://localwp.com/community/](https://localwp.com/community/)

---

## Post 14 by @ethanclevenger91 — 2020-12-30T18:53:59Z

On Windows, the line should look like this (obviously edited for your own environment):

`root "C:\Users\ethan\Local Sites\principleaccounting\app\principle-accounting\web";`

However, I’m having an issue with the latest Local where this setting isn’t used for the SSH path, so every time I try to SSH into my Local site, it tells me directory not found. It’s still looking for the old public folder.

` cd: /c/Users/Ethan/Local Sites/principleaccounting/app/public: No such file or directory`

---

## Post 15 by @Kal_Wiggins — 2021-03-01T00:34:23Z

I get everything to work locally (on mac) but it doesn’t push up to flywheel after the change to bedrock.  
" **Uh-oh! We ran into an issue when pushing this site to Flywheel.**

Do you successfully push through wp local?

Here’s what it says in my logs:  
2021/02/28 16:37:30 [error] 4053#0: \*49 FastCGI sent in stderr: “PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: ::1:9000 (from HTTP\_X\_FORWARDED\_FOR HTTP header), localhost:9000 (fallback through xdebug.client\_host/xdebug.client\_port) :-(” while reading upstream, client: 127.0.0.1, server: , request: “GET /wp-admin/?cache-buster=1688 HTTP/1.0”, upstream: “fastcgi://unix:/Users/kalwiggins/Library/Application Support/Local/run/ICM9oHu4g/php/php-fpm.socket:”, host: “epictestfive.local”

---

## Post 16 by @JulienMelissas — 2021-03-15T19:13:33Z

Hey @Kal_Wiggins - sorry for the late reply. I have never tried to push up to Flywheel, but based on the error that looks like a xdebug error. I’d ask the Flywheel team about this!

---

## Post 17 by @theMosaad — 2021-03-16T02:45:54Z

FYI, you shouldn’t be pushing the local theme files as they include development-specific packages.  
Consider a Continuous Integration services (I personally use bitbucket pipelines) to build and deploy a production version of the theme.  
Not sure if Sage is compatible with flywheel though. I use it locally but deploy to Kinsta.

---

## Post 18 by @theMosaad — 2021-03-16T02:52:53Z

@JulienMelissas a great addition to this guide would be using WP CLI from outside flywheel like we’re used to with trellis.  
It’s available to Mac and Linux as you can see in [this guide](https://salferrarello.com/wp-cli-local-by-flywheel-without-ssh/) except for using the database socket instead of db host and port that were available in older versions of Local.  
so it’d be something like

```
define('DB_HOST', 'localhost:/home/user/.config/Local/run/Sc6$DXLNK/mysql/mysqld.sock');
```

instead of

```
define('DB_HOST', '192.168.94.100:4067');
```

This allows using `wp option get siteurl` anywhere from the project’s root, and setting @production alias allows for using the sync script and a lot of functionalities similar what Trellis is offering.

---

## Post 19 by @mZoo — 2021-08-03T23:30:20Z

Very nice! Thank you.

I think this step is unnecessary with lates version of Flywheel:

> [@JulienMelissas](#):
>
> edit `~/Local Sites/bedrock/conf/nginx/site.conf` and set the root to `/app/bedrock/web/` :
> 
> ```
> -root /app/public/;
> +root /app/bedrock/web/;
> ```

The current Local configs are `.hbs` files, which seem to contain variables.

```
server {
    listen {{port}};
    root "{{root}}";
```

And my bedrock site is running nicely in the browser without any updates to that file.

---

## Post 20 by @Emanuel_Costa — 2022-02-17T01:55:10Z

Hey @ethanclevenger91 did you ever fixed this issue?

---

## Post 21 by @grayayer — 2022-02-18T21:57:54Z

because site.conf has been replaced by site.conf.hbs, you’re going to want to replace root {{root }}; with root “PWD”, where PWD is the path to your web folder within the bedrock project. So for me on a mac, this looks like: “/Users/Gray/Local Sites/bedrock/app/bedrock/web”;

I hope that helps clear things up.

---

## Post 22 by @Matt_Neal — 2022-07-22T07:00:21Z

I’m 3 years late, but this is still the correct answer. :slight_smile:

---

## Post 23 by @Amadou_Korka_Sow — 2022-07-28T17:26:12Z

Hey,

I found out that you doon’t have to chnge completly the “{{root}}” variable on documentRoot.  
You can just add “/web” which now become `{{root}}/web`.  
Tested and working on site.conf and site.conf.hbs.

Hope it helps newcomers.

---

## Post 24 by @christianmagill — 2022-08-05T17:40:42Z

This method doesn’t seem to be working for me. Am I correct that the code should look like

```
server {
	listen {{port}};
    root "{{root}}/web";
```

Replacing with the static path works.

---

## Post 25 by @cjhmdm — 2022-08-15T16:22:25Z

for those confused with latest version of Local, here’s what I did:

remove existing ‘public’ directory  
composer create-project roots/bedrock  
rename bedrock directory to public

edit site.conf.hbs, changing `root "{{root}}";` to `root "{{root}}/web";`

restart local

---

## Post 26 by @Matt_Neal — 2023-09-25T10:23:53Z

Quite frustrating that this is even a thing in 2023. Like, LocalWP, c’mon! Just let us change the doc root on setup.
