Wordpress (Bedrock)
WordPress is an open-source content management system widely used for blogging or building websites. It's known for its ease-of-use, a vast array of customizable themes and plugins, and a large global community. WordPress supports many media types, is SEO-friendly, and is a popular choice for non-technical users to create and manage websites. Wordpress Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.
Wordpress versions
The template now support the following versions of Wordpress: >6.2
May works with other versions, but not tested.
Wordpress installation
To use this template, you need to install Wordpress Bedrock first. You can do it by following the official documentation
With composer
dcmd toolbox start # in your project root folder
composer create-project roots/bedrock .
With git
git clone --branch {tag_version} https://github.com/roots/bedrock.git
Get the template
At root of your project (where the app
folder is located), run the following command:
dcmd template get wordpress
Configure the template
- Create and configure the environnement file by copying the
.env.example
file to.env
- Set the name of your project in the
docker-compose.yml
file - Set the right name for your virtual host in
.docker/etc/apache/httpd-vhosts.conf
More information here : project configuration
Do not forget to specify the DB_HOST value to db
(the name of the database container), this variable does not appear by default in .env file.
Initialize the project
At root of your project (where the app
folder is located), run the following command:
dcmd up
Setup the environment
Setup your env files, and your settings for the right database credentials and other settings.
Here are some examples:
- /web/.htaccess
- .env ...
Default database credentials
Information | default value |
---|---|
host | db |
port | 3306 |
name | default |
username | user |
password | user |
You're good to go! You can now access your project at :
http://${PROJECT_NAME}.dev.local
Installing Wordpress CLI (optional)
You can use the Wordpress CLI to manage your Wordpress.
To install it, run the following command:
dcmd composer require wp-cli/wp-cli wp-cli/wp-cli-bundle
Then you can run the WP CLI:
dcmd wp [args]