Project boilerplate for developing WordPress projects locally or deploying them to the Sitepilot managed hosting platform.
Run the following commands to create and start a new WordPress project locally.
# Create a new project
composer create-project sitepilot/project-wordpress my-site
# Start containers
docker-compose up -d
Navigate to http://localhost:8080 to access your WordPress installation.
Composer is used to manage dependencies like WordPress version and which plugins / themes are installed.
WordPress Packagist is already registered in the composer.json file so any plugin from the WordPress Plugin Directory can easily be required.
To add a plugin, add it under the require directive or use composer require <namespace>/<packagename>
from the command line. If it's from WordPress Packagist then the namespace is always wpackagist-plugin
.
Themes can also be managed by Composer but should only be done so under two conditions:
- You're using a parent theme that won't be modified at all.
- You want to separate out your main theme and use that as a standalone package.
Under most circumstances, we recommend NOT doing #2 and instead keeping your main theme as part of your app's repository.
Just like plugins, WordPress Packagist maintains a Composer mirror of the WordPress theme directory. To require a theme, just use the wpackagist-theme
namespace.
Updating your WordPress version (or any plugin) is just a matter of changing the version number in the composer.json
file. Then running composer update
will pull down the new version.
Dependabot can be used to automate updates of your Composer dependencies in your project, including WordPress itself.
You can change your project's runtime configuration by modifying the environment variables in .sitepilot/environment
.
You can change your project's PHP-configuration by modifying .sitepilot/config/php/php.ini
. You can find a list of available options here.
You can extend your project's Nginx-configuration by adding files to the appropriate .sitepilot/config/nginx/*.d
folder.
vhost-pre.d
- included before the default vhost configuration.vhost-post.d
- included after the default vhost configuration.php-allowed-list.d
- allow direct access to PHP-files.
Your WordPress installation is managed by Composer and lives in the public
folder. Every modification / addition to the public
folder will be overwritten after a Composer install or update. Add files which need to live in the document root to the root
folder.
This stack is optimized for automagically deploying your project to the Sitepilot managed hosting platform. You can request access to our fast and developer-friendly platform through our support department.
You can modify .sitepilot/deploy/00-install
or add scripts to the .sitepilot/deploy
folder to change or extend the commands which will run after pulling your code onto the server.
This project was inspired by the Bedrock WordPress boilerplate.