How to install Bedrock, a WordPress boilerplate
What is Bedrock?
Developed by https://roots.io/, Bedrock is a WordPress boilerplate used to help organize your WordPress project, structure configuration files, and manage plugins with Composer. Working as part of a team it has enabled us to maintain a standard structure for all our newly deployed WordPress sites.
The organization of Bedrock is similar to putting WordPress in its own subdirectory but with some improvements, including renaming
Bedrock uses Composer to manage your WordPress install and plugins.
Create a new folder for you new website, then use composer to install Bedrock by navigating in command line to your newly created website folder
# Create our new website folder
$ sudo mkdir -p /var/www/example.co.uk/public_html
Switch to our newly created folder:
$ cd /var/www/example.co.uk/public_html
Then run the composer install for Bedrock:
# Create a new Bedrock project
$ composer create-project roots/bedrock
That adds all the core files managed by composer. You will need to update the .env variables and enter the correct database connection details.
.env and update the variables.
The composer install of bedrock will add a bedrock folder into the root of you website folder, with all the files including a folder called web which you will need to point your vhosts file to. Example:
Your vhosts file may look like the following:
CustomLog /var/www/example.co.uk/requests.log combined
CustomLog /var/www/example.co.uk/dev_requests.log combined
In your browser navigate to the new WordPress site, and install WordPress. That will create all the database structure and your WordPress site will now be usable.