Skip to main content
  1. All Posts/

Forge

Tools Open Source PHP WordPress

<p>
  </a>
</p>

<p>
  <strong>A modern WordPress stack</strong>
</p>

<p>
  Built with ❤️
</p>

<p>
  <a rel="nofollow noopener" target="_blank" href="https://roots.io">Official Website</a> | <a rel="nofollow noopener" target="_blank" href="https://roots.io/docs/bedrock/master/installation/">Documentation</a> | Change Log
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-supporting" class="anchor" aria-hidden="true" href="#supporting"></a>Supporting
</h2>

<p>
  <strong>Bedrock</strong> is an open source project and completely free to use.<br /> However, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below:
</p>

<p>
  <a rel="nofollow noopener" target="_blank" href="https://www.patreon.com/rootsdev"></a><br /> <a rel="nofollow noopener" target="_blank" href="https://www.paypal.me/rootsdev"></a>
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-overview" class="anchor" aria-hidden="true" href="#overview"></a>Overview
</h2>

<p>
  Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.<br /> Much of the philosophy behind Bedrock is inspired by the <a rel="nofollow noopener" target="_blank" href="http://12factor.net/">Twelve-Factor App</a> methodology including the <a rel="nofollow noopener" target="_blank" href="https://roots.io/twelve-factor-wordpress/">WordPress specific version</a>.
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-features" class="anchor" aria-hidden="true" href="#features"></a>Features
</h2>

<ul dir="auto">
  <li>
    Better folder structure
  </li>
  <li>
    Dependency management with <a rel="nofollow noopener" target="_blank" href="https://getcomposer.org">Composer</a>
  </li>
  <li>
    Easy WordPress configuration with environment specific files
  </li>
  <li>
    Environment variables with Dotenv
  </li>
  <li>
    Autoloader for mu-plugins (use regular plugins as mu-plugins)
  </li>
  <li>
    Enhanced security (separated web root and secure passwords with wp-password-bcrypt)
  </li>
</ul>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-requirements" class="anchor" aria-hidden="true" href="#requirements"></a>Requirements
</h2>

<ul dir="auto">
  <li>
    PHP >= 7.4
  </li>
  <li>
    Composer &#8211; <a rel="nofollow noopener" target="_blank" href="https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx">Install</a>
  </li>
</ul>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-installation" class="anchor" aria-hidden="true" href="#installation"></a>Installation
</h2>

<ol dir="auto">
  <li>
    Create a new project: <pre>$ composer create-project roots/bedrock</pre>
  </li>
  
  <li>
    Update environment variables in the <code>.env</code> file. Wrap values that may contain non-alphanumeric characters with quotes, or they may be incorrectly parsed.
  </li>
</ol>

<ul dir="auto">
  <li>
    Database variables <ul dir="auto">
      <li>
        <code>DB_NAME</code> &#8211; Database name
      </li>
      <li>
        <code>DB_USER</code> &#8211; Database user
      </li>
      <li>
        <code>DB_PASSWORD</code> &#8211; Database password
      </li>
      <li>
        <code>DB_HOST</code> &#8211; Database host
      </li>
      <li>
        Optionally, you can define <code>DATABASE_URL</code> for using a DSN instead of using the variables above (e.g. <code>mysql://user:password@127.0.0.1:3306/db_name</code>)
      </li>
    </ul>
  </li>
  
  <li>
    <code>WP_ENV</code> &#8211; Set to environment (<code>development</code>, <code>staging</code>, <code>production</code>)
  </li>
  <li>
    <code>WP_HOME</code> &#8211; Full URL to WordPress home (<a rel="nofollow noopener" target="_blank" href="https://example.com">https://example.com</a>)
  </li>
  <li>
    <code>WP_SITEURL</code> &#8211; Full URL to WordPress including subdirectory (<a rel="nofollow noopener" target="_blank" href="https://example.com/wp">https://example.com/wp</a>)
  </li>
  <li>
    <code>AUTH_KEY</code>, <code>SECURE_AUTH_KEY</code>, <code>LOGGED_IN_KEY</code>, <code>NONCE_KEY</code>, <code>AUTH_SALT</code>, <code>SECURE_AUTH_SALT</code>, <code>LOGGED_IN_SALT</code>, <code>NONCE_SALT</code></p> <ul dir="auto">
      <li>
        Generate with wp-cli-dotenv-command
      </li>
      <li>
        Generate with <a rel="nofollow noopener" target="_blank" href="https://roots.io/salts.html">our WordPress salts generator</a>
      </li>
    </ul>
  </li>
</ul>

<ol start="3" dir="auto">
  <li>
    Add theme(s) in <code>web/app/themes/</code> as you would for a normal WordPress site
  </li>
  <li>
    Set the document root on your webserver to Bedrock&#8217;s <code>web</code> folder: <code>/path/to/site/web/</code>
  </li>
  <li>
    Access WordPress admin at <code>https://example.com/wp/wp-admin/</code>
  </li>
</ol>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-documentation" class="anchor" aria-hidden="true" href="#documentation"></a>Documentation
</h2>

<p>
  Bedrock documentation is available at <a rel="nofollow noopener" target="_blank" href="https://roots.io/docs/bedrock/master/installation/">https://roots.io/docs/bedrock/master/installation/</a>.
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-contributing" class="anchor" aria-hidden="true" href="#contributing"></a>Contributing
</h2>

<p>
  Contributions are welcome from everyone. We have contributing guidelines to help you get started.
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-bedrock-sponsors" class="anchor" aria-hidden="true" href="#bedrock-sponsors"></a>Bedrock sponsors
</h2>

<p>
  Help support our open-source development efforts by <a rel="nofollow noopener" target="_blank" href="https://www.patreon.com/rootsdev">becoming a patron</a>.<br /> <a rel="nofollow noopener" target="_blank" href="https://kinsta.com/?kaid=OFDHAJIXUDIV"></a> <a rel="nofollow noopener" target="_blank" href="https://k-m.com/"></a> <a rel="nofollow noopener" target="_blank" href="https://carrot.com/"></a> <a rel="nofollow noopener" target="_blank" href="https://www.c21redwood.com/"></a> <a rel="nofollow noopener" target="_blank" href="https://wordpress.com/"></a> <a rel="nofollow noopener" target="_blank" href="https://pantheon.io/"></a>
</p>

<h2 dir="auto">
  <a rel="nofollow noopener" target="_blank" id="user-content-community" class="anchor" aria-hidden="true" href="#community"></a>Community
</h2>

<p>
  Keep track of development and community news.
</p>

<ul dir="auto">
  <li>
    Participate on the <a rel="nofollow noopener" target="_blank" href="https://discourse.roots.io/">Roots Discourse</a>
  </li>
  <li>
    Follow <a rel="nofollow noopener" target="_blank" href="https://twitter.com/rootswp">@rootswp on Twitter</a>
  </li>
  <li>
    Read and subscribe to the <a rel="nofollow noopener" target="_blank" href="https://roots.io/blog/">Roots Blog</a>
  </li>
  <li>
    Subscribe to the <a rel="nofollow noopener" target="_blank" href="https://roots.io/subscribe/">Roots Newsletter</a>
  </li>
  <li>
    Listen to the <a rel="nofollow noopener" target="_blank" href="https://roots.io/podcast/">Roots Radio podcast</a>
  </li>
</ul>

<p>
</p>