Setup Bedrock

How to setup Bedrock on Templ.

Emanuel avatar
Written by Emanuel
Updated over a week ago

Bedrock is a WordPress boilerplate with a more modern folder structure that can make life easier for developers.

You can follow this guide to set up Bedrock on Templ.

Install Bedrock on Templ

Firstly, you would need to either upload your existing Bedrock site to Templ or create a new Bedrock project.

To create a new Bedrock project using composer, connect to your site using SSH and run:

composer create-project roots/bedrock

NOTE: You can place your Bedrock project anywhere but inside your web root directory.

"Change" web root directory

The web root folder on Templ is fixed as /home/user_xxxx/app_xxxx.

To be able to serve our Bedrock site, which is placed outside of the web root folder, we can replace the web root folder with a symbolic link pointing to Bedrock.

Remove your current web root directory together with its content:

rm -rf app_xxxx

Then we need to create a relative symbolic link pointing the web root folder to the folder inside Bedrock where index.php and wp-config.php is located, e.g.:

ln -s bedrock/web/ app_xxxx

For this change to have effect, you also have to restart your website in the Templ control panel.

NOTE: Our backup feature will only back up content in app_xxxx. If you have e.g your uploads folder outside the root directory (pointed with a symbolic link) please notify us so we can make sure that folder is backed up.

Update credentials in .env

Lastly you also need to update the credentials inside of our .env file that's inside the Bedrock folder.

You typically need to update at least the following credentials:

  • DB_NAME

  • DB_USER

  • DB_PASSWORD

  • WP_HOME

You can find your site's database credentials as well as its domain name in the Templ control panel.

NOTE: You should also make sure to replace the salts for better security.

Did this answer your question?