Webhaven runs locally on DDEV, a Docker-based local development environment for PHP projects.
DDEV helps you to spin up Webhaven projects fast without any hassle and improves the developer experience a lot.
Prerequisites
Before installing Webhaven, make sure you have the following installed:
- DDEV (Install DDEV)
- Git (Install Git)
To check if DDEV is installed on your system open up your terminal and run:
ddev --version
You should see the installed version printed.
To check if Git is installed on your system run:
git -v
You should see the installed version printed.
Clone the repository
Clone the Webhaven project repository:
git clone <repo-url> webhaven
cd webhaven
composer install
you can replace webhaven with whatever you like as a directory name.
Setup the DDEV environment and launch it
Now it's time to initialize and start the DDEV environment:
ddev config --project-type=drupal11 --docroot=web;
ddev start;
ddev composer install;
ddev composer drupal:recipe-unpack;
ddev launch;
Let's take a closer look at all these commands.
DDEV configuration
First we setup our DDEV project with
ddev config --project-type=drupal11 --docroot=web
And then we start DDEV to create the required containers for PHP, the database, and other services so the first time you run this command the process will take a bit longer.
ddev startInstall dependencies
Then we run the following inside the DDEV container to install dependencies:
ddev composer install
This installs all PHP dependencies, including Drupal core and the Webhaven dependencies.
Unpack recipes
Webhaven comes with recipes that we want to use.
ddev composer drupal:recipe-unpack
This turns Webhaven recipes into normal modules and settings, so your site no longer depends on the recipe.
Run a fresh Webhaven installation
Run the following command to launch the Webhaven container.
ddev launch
Follow the instructions and congratulations. You have your first Webhaven project up and running.