FAQs
This page answers the questions that developers ask most often while they work on a Vortex project, from running commands to recovering a stuck test. Each answer links to the page that covers its topic in full.
How to know which ahoy commands are available?
To list the commands with their descriptions, run the following command:
ahoy help
➡️ See Environment > Ahoy
How to pass CLI arguments to commands?
Add the arguments and options after the command name and a -- separator:
ahoy mycommand -- myarg1 myarg2 --myoption1 --myoption2=myvalue
➡️ See Environment > Ahoy
How to clear Drupal cache?
To rebuild the Drupal caches, run the following command:
- Ahoy
- Docker Compose
ahoy drush cr
docker compose exec cli drush cr
➡️ See Environment > Drush
How to login to a Drupal site?
To unblock user 1 and print a one-time login link for it, run the following command:
- Ahoy
- Docker Compose
ahoy login
# Unblocks user 1 and generates a one-time login link, like
# `ahoy login`.
docker compose exec cli ./vendor/bin/vortex-login
➡️ See Environment > Drush
How to connect to the database?
To connect, first get the port that the database uses on your host:
- Ahoy
- Docker Compose
On macOS with Sequel Ace installed, open the database in it:
ahoy db
Otherwise, follow these steps:
- Run
ahoy info, which prints the port asDB port on host. - Use the following connection details.
- Run
docker compose port database 3306to get the host port, or find the database port mapping indocker compose ps. - Use the following connection details.
Connect with these details:
- Host:
127.0.0.1 - Username:
drupal - Password:
drupal - Database:
drupal - Port: the port from the preceding step
➡️ See Environment > Docker
How to use Xdebug?
Turn Xdebug on in the containers, then start a debug session from your IDE:
- Ahoy
- Docker Compose
- Run
ahoy debug. Afterphp -vin the CLI container confirms that Xdebug loaded, it printsEnabled debug configuration. Use 'ahoy up' to disable.To check the state later, runahoy info: itsXdebugline readsEnabled ('ahoy up cli' to disable)while Xdebug is on. - Turn on listening for incoming debug connections in your IDE.
- If your IDE asks for a server URL, give it the URL as it appears in the browser.
- Turn on the Xdebug flag in the requests from your browser, with 1 of
the extensions or by adding
?XDEBUG_SESSION_START=1to the URL. - Set a breakpoint in your IDE and load the page in your browser.
Use the same commands to debug CLI scripts.
To turn Xdebug off, run ahoy up. The ahoy info line suggests
ahoy up cli instead, but that recreates only the cli container, so
web requests still run with Xdebug in the appserver container.
- Run
XDEBUG_ENABLE=true docker compose up -d cli appserver webserver. To check that Xdebug loaded, rundocker compose exec cli php -vand look for Xdebug in its output. - Turn on listening for incoming debug connections in your IDE.
- If your IDE asks for a server URL, give it the URL as it appears in the browser.
- Turn on the Xdebug flag in the requests from your browser, with 1 of
the extensions or by adding
?XDEBUG_SESSION_START=1to the URL. - Set a breakpoint in your IDE and load the page in your browser.
Use the same commands to debug CLI scripts.
To turn Xdebug off, run docker compose up -d cli appserver webserver.
➡️ See Environment > Debugging
How to use Xdebug with Behat?
Turn Xdebug on, then run Behat with the --xdebug flag inside the CLI
container:
- Ahoy
- Docker Compose
- Enable debugging:
ahoy debug - Enter CLI container:
ahoy cli - Run Behat tests:
vendor/bin/behat --xdebug path/to/test.feature
- Enable debugging:
XDEBUG_ENABLE=true docker compose up -d cli appserver webserver - Enter CLI container:
docker compose exec cli bash - Run Behat tests:
vendor/bin/behat --xdebug path/to/test.feature
➡️ See Environment > Debugging and Testing > Behat
What should I do to switch to a "clean" branch environment?
If your stack is already running, follow these steps:
- Ahoy
- Docker Compose
- Switch to your branch.
- Run
ahoy composer install. - If the branch changes theme files, run
ahoy fe. - Run
ahoy provision.
You don't need to rebuild the full stack with ahoy build every time
you switch branches. ahoy provision updates the environment to match
the current branch, applying its database updates and configuration.
ahoy provision asks you to confirm first. It then keeps an existing
site's database, because .env sets VORTEX_PROVISION_OVERRIDE_DB to
0. It replaces the database only when that variable is 1, as
.env.local.example sets it, or when VORTEX_DB_IMAGE is set. With
VORTEX_DB_IMAGE, it reloads the database container from that image
first. A value in .env.local overrides the one in .env, so check
both files to see which case applies to you.
When you need a fully clean environment, use ahoy build.
- Switch to your branch.
- Run
docker compose exec cli composer install. - If the branch changes theme files, rebuild the theme assets with
npm run buildin the theme directory inside the CLI container. - Run
docker compose exec cli ./vendor/bin/vortex-provision.
You don't need to rebuild the full stack every time you switch branches.
The provision script updates the environment to match the current
branch. Like ahoy provision, it keeps an existing site's database by
default, but it doesn't ask for confirmation or reload the database
container.
When you need a fully clean environment, run the following commands,
which mirror the steps of ahoy build. vortex-reset deletes every
node_modules directory, so the commands reinstall the front-end
dependencies and rebuild the theme before they provision the site:
docker compose down --remove-orphans --volumes
./vendor/bin/vortex-reset
docker compose up -d --build --force-recreate
docker compose exec cli composer install
docker compose exec cli npm ci
docker compose exec cli bash -c \
"npm --prefix=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} ci"
docker compose exec cli bash -c \
"cd \${WEBROOT}/themes/custom/\${DRUPAL_THEME} && npm run build"
docker compose exec cli ./vendor/bin/vortex-provision
➡️ See Environment > Switching branches
How to import a database without running updates?
The import drops the current database and loads the dump without running database updates or importing configuration. If your stack is already running, pick the command for your dump file:
- Ahoy
- Docker Compose
Import from the default dump file at .data/db.sql:
ahoy import-db
Import from a specific dump file:
ahoy import-db .data/db_custom.sql
Import from the default dump file at .data/db.sql:
docker compose exec cli ./vendor/bin/vortex-import-db
Import from a specific dump file:
docker compose exec cli ./vendor/bin/vortex-import-db \
.data/db_custom.sql
ahoy import-db asks you to confirm before it replaces the database.
Confirm that the output ends with Finished database import.
➡️ See Provision > Database
How to add Drupal modules?
To add a module's code to the project, require it with Composer:
- Ahoy
- Docker Compose
ahoy composer require drupal/module_name
docker compose exec cli composer require drupal/module_name
Then install the module with drush pm:install, and export the
configuration with drush config:export. The exported configuration keeps
the module installed after the next configuration import.
➡️ See Composer > Installing and Modules
How to add patches for Drupal modules?
To patch a module, follow these steps:
-
Add the patch to
extra.patchesincomposer.json, under the package's name. Use the patch description as the key and the patch URL or local path as the value:"extra": {"patches": {"drupal/somepackage": {"Remote patch description": "https://www.drupal.org/files/issues/issue.patch","Local patch description": "patches/package-description.patch"}}} -
Regenerate the patches lock file, re-apply the patches, and update
composer.lock:
- Ahoy
- Docker Compose
ahoy composer patches-relock
ahoy composer patches-repatch
ahoy composer update --lock
docker compose exec cli composer patches-relock
docker compose exec cli composer patches-repatch
docker compose exec cli composer update --lock
Confirm that the patches-repatch output has a - Patching line with the
name of the patched package.
➡️ See Composer > Patching for the full patching workflow, including removing patches.
What should I do when composer audit reports a security vulnerability?
Vortex sets config.policy.advisories.block to false in
composer.json, so security advisories don't block composer update,
composer require, or composer remove. composer install installs
exactly what the lock file pins, so advisories never block it.
composer audit reports the advisories instead, both when you run it
locally and in the CI security audit workflow. When it reports an
advisory, follow these steps:
- Try updating the affected package to a newer version that resolves the
advisory:
composer update vendor/package-name. - Run
composer auditto review the advisory details and assess whether it affects your project. - If no fixed version exists yet, or the vulnerability doesn't affect your
use case, add the advisory to the
config.policy.advisories.ignore-idlist incomposer.jsonwith a documented reason. - Optional: To let CI pass while you address the advisory, set
VORTEX_CI_COMPOSER_AUDIT_IGNORE_FAILUREto1, as a repository variable on GitHub Actions or as an environment variable in the CircleCI project settings.
➡️ See Security > Dependency audit for the
full config.policy reference and guidance on choosing the right settings
for your project.
What should I do when npm audit reports a security vulnerability?
The CI security audit workflow runs npm audit through audit-ci against
the root and the custom theme's dependency trees. It fails on advisories
rated high or higher. The Audit npm packages step checks the root, and
Audit npm packages of the theme checks the theme in
web/themes/custom/your_site_theme. When a step reports an advisory,
follow these steps in the directory it checks:
- Try updating the affected package to a newer version that resolves the
advisory:
npm update <package-name>. - Run
npm auditto review the advisory details, including which direct dependency pulls the affected package in, and assess whether it affects your project. - When the affected package isn't a direct dependency, pin a patched
version of it with an
overridesentry inpackage.json, then runnpm install. - If no fixed version exists or the vulnerability doesn't affect you, add
it to the
allowlistin that directory'spackage-audit.jsonc, with notes and an expiry date. The root and theme files each apply only to their own tree. - Optional: To let CI pass while you address the advisory, set
VORTEX_CI_NPM_AUDIT_IGNORE_FAILUREto1, as a repository variable on GitHub Actions or as an environment variable in the CircleCI project settings.
➡️ See Security > Dependency
audit for the
severity threshold, the overrides mechanism, and the allowlist format.
How to set a custom maintenance theme?
To set a custom theme for Drupal's maintenance mode (when the site is
offline for updates), set the DRUPAL_MAINTENANCE_THEME environment
variable:
# In .env file
DRUPAL_MAINTENANCE_THEME=my_custom_theme
Drupal uses this theme while the site is in maintenance mode. The Vortex
CLI sets it in .env to the theme you chose for the site. When
DRUPAL_MAINTENANCE_THEME isn't set, settings.php falls back to the value
of DRUPAL_THEME, and to Claro when neither is set.
Use a valid Drupal theme that's already installed and enabled on your site.
➡️ See Environment > Environment variables
Behat tests with @javascript tag sometimes get stuck
A scenario tagged @javascript sometimes hangs for about 10 minutes and
then fails, because the browser container stops responding. It happens at
random, and its cause is unknown. To recover, restart the browser
container with docker compose restart browser or ahoy restart browser.
Confirm that the scenario passes when you run the Behat tests again.
➡️ See Testing > Behat