# Bedrock setup with Local (by Flywheel)

**URL:** https://discourse.roots.io/t/bedrock-setup-with-local-by-flywheel/29136
**Category:** bedrock
**Tags:** local
**Created:** 2025-01-22T22:58:20Z
**Posts:** 9

## Post 1 by @bwalden — 2025-01-22T22:58:20Z

I just used Local to spin up a new site and followed the Bedrock + Local installation instructions. The new folder structure I get, however, doesn’t match what the instructions describe: the **/app** directory is missing the **/sql** directory.

 ![Screenshot 2025-01-22 at 2.58.59 PM](https://discourse.roots.io/uploads/default/original/2X/b/bd059fc044bdc69e3c55a416d55047846160931b.png)

Any ideas why this is and how I can fix it? I’ve been working for hours, trying to install Sage by itself, and encountering errors connecting to the database. I tried Bedrock, thinking maybe the database issue would be resolved there, but I’m betting the absence of that **/sql** directory spells ongoing trouble.

- MacOS 15.2
- Local v9.1.1+6738
- Web server: nginx
- PHP 8.2.23
- MySQL 8.0.16
- WordPress v6.7.1

---

## Post 2 by @ben — 2025-01-23T04:16:13Z

I just followed the [guide for Bedrock and Local](https://roots.io/bedrock/docs/bedrock-with-local/) on a fresh install of macOS and everything is working fine for me

~~It looks like that folder used to be there and it no longer is, but the docs were just showing it for the purpose of helping show the directory structure. Bedrock doesn’t actually require any changes or anything to do with that directory for Local support — you just need to update the web root.~~ It looks like that folder shows up at some point, but it isn’t there right away during a new install.

> [@bwalden](#):
>
> I’ve been working for hours, trying to install Sage by itself, and encountering errors connecting to the database.

What errors?

If you copied `.env.example` to `.env` and followed the docs, things should hopefully be working. My full `.env` looks like:

```
DB_NAME='local'
DB_USER='root'
DB_PASSWORD='root'

# Optionally, you can use a data source name (DSN)
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'

# Optional database variables
# DB_HOST='localhost'
# DB_PREFIX='wp_'

WP_ENV='development'
WP_HOME='http://bedrock.local'
WP_SITEURL="${WP_HOME}/wp"

# Specify optional debug.log path
# WP_DEBUG_LOG='/path/to/debug.log'

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
```

---

## Post 3 by @bwalden — 2025-01-23T18:39:07Z

Thanks very much, @ben! I’ll have another go at it today. I’m sure it’s user error, but maybe I can find what I did wrong, and your advice will be super helpful.

Here’s the command and resulting error:  
`wp acorn acorn:install`  
`Error: Error establishing a database connection.`

For the Sage-only install, I definitely hadn’t set up my .env properly (is there a .env?) So that may be the issue right there. Thought I followed the instructions to the letter, but I guess not. I’ll try it Sage-only first, then with Bedrock + Sage, see if I can make it happen this time. Thanks again!

---

## Post 4 by @bwalden — 2025-01-27T23:28:06Z

Hi again, @ben. I followed your instructions very carefully and am still unable to connect to the new site:

 ![Screenshot 2025-01-27 at 3.21.40 PM](https://discourse.roots.io/uploads/default/original/2X/5/527ed5febd4cf969868bb1c634d6608cce1d3b5b.png)

Here’s my LocalWP screen:

 ![Screenshot 2025-01-27 at 3.20.47 PM](https://discourse.roots.io/uploads/default/original/2X/6/6e69d4a0848689ff13bd6a6b5de22b2d7c93d65b.png)

I set the .env file like this:

```
DB_NAME='local'
DB_USER='root'
DB_PASSWORD='root'
WP_ENV='development'
WP_HOME='http://bedrock.local'
WP_SITEURL="${WP_HOME}/wp"
```

and my site.conf.hbs file looks like this:

```
server {
	listen 127.0.0.1:{{port}};
	listen [::1]:{{port}};
    root "/Users/bwalden/Local Sites/wordpress/bedrock/app/bedrock/web";
```

I have Laravel Herd installed—for the Statamic sites I build and maintain—but I’ve quit out of it, so I’m not sure how to move forward from here. Seems like such a straightforward installation process.

---

## Post 5 by @ben — 2025-01-27T23:39:52Z

Look at your `.env` file — your `WP_HOME` does not match your Local site host

Not being able to connect to your Local site should be unrelated to Bedrock

> **[What is Router Mode?](https://localwp.com/help-docs/advanced/router-mode/)**
>
> Router Mode is Local’s way of offering the best offline development experience possible while still “playing nice” with other, similar development applications.

---

## Post 6 by @bwalden — 2025-01-28T00:12:01Z

Sorry, @ben. Are you saying that, using localhost mode, I can’t set WP\_HOME to “[http://bedrock.local](http://bedrock.local)”? Idiot that I am—would you be able to spell it out for me, please? I’m afraid I’ll spend all day guessing and never land on the correct answer. Thanks!

---

## Post 7 by @bwalden — 2025-01-28T01:07:50Z

Just did a complete from-scratch reinstall of LocalWP site and Bedrock. LocalWP says my Site Host is “localhost:10004” so I set WP\_HOME to “localhost:10004” …

Did this, too:

```
server {
    listen localhost:10004;
    # listen [::1]:{{port}};
    root "/Users/bwalden/Local Sites/wordpress/bedrock/app/bedrock/web";
```

Still will not connect. I understand it’s nothing to do with Bedrock—I’m missing a simple setting. What am I missing?

---

## Post 8 by @bwalden — 2025-01-28T19:17:50Z

Figured it out.

I’m using the Arc browser. That’s the problem. For whatever reason, it’s not honoring the port number on **localhost** , automatically changing `http://localhost:10004` to `http://localhost`. Even stranger, Arc does this in one of my spaces, but not the other.

Lost a whole lot of time to a browser bug. Hope this saves somebody else a few hours!

---

## Post 9 by @mediaformat — 2025-02-17T21:23:13Z

> [@ben](#):
>
> `# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'`

Just adding a note that on some projects Local wasn’t connecting to the db for me, and I had to add the path to Local’s mysqld file, like so:  
`DB_HOST=localhost:"/Users/moi/Library/Application%20Support/Local/run/SMzVYmO9L/mysql/mysqld.sock"`
