A Coder workspace template for developing Drupal contrib modules and themes, with full support for working on specific issue branches from drupal.org.
- Full DDEV environment β DDEV with the official
ddev-drupal-contribaddon - Any contrib project β Clone any module or theme from git.drupalcode.org by machine name
- Issue branch support β Automatically fetch and checkout issue forks from drupal.org
- Symlinked module β Module/theme is symlinked into the Drupal web root automatically (
ddev symlink-project) - Dev tools included β PHPUnit, PHPStan, PHPCS, ESLint, Stylelint via DDEV commands
- Multiple Drupal versions β Supports Drupal 10.x, 11.x, and 12.x as the dev dependency
- VS Code for Web β Opens at your module root; PHP Debug, Intelephense, and more
Visit the Drupal Issue Picker at your Coder instance. Paste any drupal.org project or issue URL β the picker detects contrib projects automatically and routes to this template.
# Plain development on a contrib module (HEAD)
coder create --template drupal-contrib my-workspace \
--parameter project_name=token \
--parameter drupal_version=11 \
--yes
# Working on a specific issue
coder create --template drupal-contrib issue-3568144 \
--parameter project_name=views \
--parameter issue_fork=3568144 \
--parameter issue_branch=3568144-fix-something-2.x \
--parameter drupal_version=11 \
--yes/home/coder/{project_name}/ # Module/theme git repo
βββ {source files}
βββ composer.json # Module's own composer.json (unchanged)
βββ composer.contrib.json # Temp file by ddev poser (gitignored)
βββ .ddev/ # DDEV configuration
βββ vendor/ # Installed dependencies
βββ web/ # Drupal docroot
βββ modules/custom/{name} -> /home/coder/{name} (symlink)
# (or themes/custom/{name} for themes)
The module/theme repo is the project root. Drupal core is installed as a dev dependency in web/. A symlink makes Drupal aware of your module without copying files.
| Parameter | Default | Notes |
|---|---|---|
project_name |
β | Drupal.org machine name (required, not mutable after creation) |
project_type |
module |
module or theme (not mutable after creation) |
drupal_version |
11 |
10, 11, or 12 |
issue_fork |
β | Issue number; empty = plain HEAD |
issue_branch |
β | Branch name; empty = default branch HEAD |
install_profile |
minimal |
minimal, standard, or demo_umami |
After setup, access your Drupal site through:
- Coder dashboard β Click the "Drupal Site" app button
- CLI β
coder ssh <workspace-name>thenddev launch
Admin credentials: admin / admin
# Inside the workspace (via coder ssh or VS Code terminal):
ddev launch # Show site URL and one-time login link
ddev describe # Show project details and URLs
# Testing and quality (from ddev-drupal-contrib addon)
ddev phpunit # Run PHPUnit tests for your module
ddev phpcs # Check Drupal coding standards
ddev phpcbf # Auto-fix coding standard issues
ddev phpstan # Run PHPStan static analysis
ddev eslint # JavaScript linting
ddev stylelint # CSS linting
# Drupal management
ddev drush en {module} # Enable a module
ddev drush cr # Rebuild cache
ddev drush uli # One-time login link
ddev drush status # Check status
# DDEV management
ddev start / ddev stop # Start or stop containers
ddev logs # View container logs
ddev ssh # SSH into the web container
ddev restart # Restart containers- Find an issue at
drupal.org/project/{module}/issues - Use the Drupal Issue Picker on your Coder instance to launch a workspace, OR pass
issue_forkandissue_branchparameters manually - The issue branch is automatically checked out in
/home/coder/{project_name} - Make your changes, run tests, commit and push
# View your working branch
git -C ~/views branch --show-current
# Run tests for your module
cd ~/views
ddev phpunit web/modules/custom/views/tests
# Check coding standards
ddev phpcs web/modules/custom/viewsWhen project_type=theme, the symlink is placed at web/themes/custom/{name} instead of web/modules/custom/{name}. Enable your theme with:
ddev drush theme:enable {theme_name} -y
ddev drush config-set system.theme default {theme_name} -y- Coder v2.13+
- Sysbox runtime on agent nodes (
sysbox-runc) - Network access to git.drupalcode.org and packagist.org
Clone failed: Check that project_name is a valid drupal.org machine name. Verify it exists at git.drupalcode.org/project/{name}.
Issue fork not found: The issue fork URL (git.drupalcode.org/issue/{module}-{issue}) may not exist yet. Create it from the issue page on drupal.org by clicking "Create issue fork."
ddev poser failed: Check setup logs with cat /tmp/drupal-setup.log. The module's composer.json may need adjustments for the target Drupal version.
Module not found after symlink: Run ddev restart to retrigger ddev symlink-project. Then ddev drush en {module_name}.
Full setup log: cat /tmp/drupal-setup.log
Setup status summary: cat ~/SETUP_STATUS.txt