ARTICLE

Magento 2 Local Development Environments: Warden vs DDEV vs docker-magento, Xdebug Setup, and Running Hyva Builds Locally

Magento 2 Local Development Environments: Warden vs DDEV vs docker-magento, Xdebug Setup, and Running Hyva Builds Locally

For Magento 2 and Hyva work, the three common Docker-based local environments are Warden, DDEV, and docker-magento. Warden and docker-magento are built around Magento and ship its service stack. DDEV is a general PHP tool with a magento2 project type and add-ons. All three can run Xdebug; they differ in triggers, macOS file sync, and Windows support.

None of them is wrong. The right pick depends on what else your team works on, which operating systems your developers use, and how closely you want local to match staging. This guide compares them on the points that actually decide it, shows how Xdebug works in each, and covers the detail most comparisons skip: where to run the Hyva Tailwind build so it reads the same files Magento does. For context on how we set up and hand over projects, see our Magento development services.

Why Magento needs more than a PHP container

A working Magento 2 install is a small cluster. At minimum you need a web server, PHP-FPM with the right extensions, MySQL or MariaDB, a search engine (OpenSearch on current 2.4 releases), and a cache. Most real projects add Redis or Valkey for cache and sessions, RabbitMQ for message queue consumers, Varnish for full page cache, and a mail catcher so order emails do not go to real customers.

Running all that by hand on a laptop is where the classic “works on my machine” bugs come from: a different PHP minor version, a missing extension, Elasticsearch where production runs OpenSearch. A containerized environment pins those versions in a file that lives in the repository, so every developer, and the CI pipeline, starts from the same stack.

The three tools at a glance

Warden DDEV docker-magento
Focus PHP apps with special Magento support; also Laravel, Shopware, Symfony, WordPress General PHP and CMS projects with a magento2 project type Magento only
Shared services Traefik for SSL, Dnsmasq, Portainer, run once per machine ddev-router per machine Per project
Magento services Nginx, Varnish, PHP-FPM, MariaDB, Elasticsearch, RabbitMQ, Redis (per its environment types page) Web and database by default; OpenSearch via add-on Nginx, PHP-FPM, MariaDB, OpenSearch by default, Redis, RabbitMQ, Varnish (off by default), Mailcatcher, phpMyAdmin
Xdebug trigger XDEBUG_SESSION cookie routes requests to a php-debug container ddev xdebug on, off, toggle XDEBUG_SESSION cookie routes to a phpfpm-xdebug container
macOS file performance Mutagen sync for the webroot, pub/media mounted Configured through DDEV’s performance mode settings; test with your own project size Optional SSH/SFTP mode for native filesystem speed
Windows README documents macOS and Linux Documented WSL2 support, including IDE location settings Supported through Docker on WSL
Hyva helpers None built in None built in bin/setup-hyva, bin/hyva-build, bin/hyva-watch
License MIT Open source MIT

The service lists above come from each project’s own documentation, which is updated at different speeds. Warden’s environment types page, for instance, still lists Elasticsearch and PHP 7.0+; check the current release notes for the search engine and PHP versions you need before you commit.

Warden

Warden runs a set of global services once per machine, including Traefik for SSL termination and Dnsmasq for local domains, then starts per-project environments on top. Its environment types documentation describes the magento2 type as providing Nginx, Varnish, PHP-FPM, MariaDB, Elasticsearch, RabbitMQ, and Redis, with mail sent through mhsendmail and viewable in a shared webmail interface.

Xdebug. Warden runs a separate php-debug container. Setting the XDEBUG_SESSION cookie in the browser, usually with the Xdebug Helper extension and the PHPSTORM key, makes Nginx route that request to the debug container. For CLI work, warden debug opens a shell in the debug container so bin/magento commands connect to your IDE. Xdebug 3 uses port 9003.

The advantage of the two-container design is that normal page loads never pay the Xdebug performance cost. You only hit the slow container when the cookie is set.

macOS. On macOS, Warden syncs the webroot into the container with a Mutagen session, except pub/media, which stays on a mount. On Linux it uses native mounts. Mutagen gives near-native speed for PHP, but it is a sync, not a mount, so you occasionally wait for large changes like a fresh vendor directory to finish syncing.

Best fit. Teams doing mostly Magento with some Shopware or Laravel, on macOS or Linux, who want Varnish and RabbitMQ in local by default.

DDEV

DDEV is a general-purpose local environment used heavily in the Drupal, WordPress, and TYPO3 worlds, with a magento2 project type. Its quickstart for Magento sets up the project with ddev config using the magento2 project type, pub as the docroot, and media as the upload directory, then adds OpenSearch with ddev add-on get ddev/ddev-opensearch before running composer create-project and setup:install through ddev.

Services beyond web and database come from add-ons, so Redis, RabbitMQ, and Varnish are separate decisions. That is either a strength or a chore, depending on whether you want a minimal stack or a production-like one.

Xdebug. DDEV keeps Xdebug off by default for performance. You turn it on with ddev xdebug on, off with ddev xdebug off, and check it with ddev xdebug status. It stays on until the project restarts. Two details trip people up: the IDE listens on port 9003, and Composer disables Xdebug on its own unless you set COMPOSER_ALLOW_XDEBUG=1.

Windows. DDEV has the most detailed WSL2 documentation of the three, including a global setting for when the IDE itself runs inside WSL2 and notes for mirrored networking mode.

Best fit. Agencies and in-house teams that work across many PHP platforms and want one tool for all of them, and teams with developers on Windows.

docker-magento

docker-magento is a Magento-only environment with its own images for Nginx, PHP (with matching Xdebug variants), OpenSearch, Elasticsearch, RabbitMQ, and Varnish. Its README says OpenSearch is the default search engine and Redis is the default cache and session store, while Varnish is disabled by default. Mailcatcher captures outgoing mail on port 1080, and phpMyAdmin runs on port 8080.

Setup is a single command that downloads the template, a Magento or Mage-OS version, and runs the install. The README asks for at least 6GB of RAM allocated to Docker, a dual-core CPU, and an SSD.

Xdebug. Like Warden, it runs a dedicated phpfpm-xdebug container that the XDEBUG_SESSION cookie routes to. The older bin/xdebug toggle script is now marked deprecated for that reason. For CLI debugging, bin/debug-cli runs a command inside the Xdebug container, for example a reindex you want to step through.

macOS and Windows. The README states it is tested on macOS and Linux, with Windows supported through Docker on WSL. For macOS file performance it offers an SSH/SFTP mode, introduced in version 40.0.0, that keeps files on the container’s native filesystem.

Hyva. It is the only one of the three with Hyva helpers built in: bin/setup-hyva installs the theme’s Node dependencies, bin/hyva-build runs a one-off production build, and bin/hyva-watch rebuilds on CSS changes. The README is explicit that these should run inside the container rather than on the host.

Best fit. Magento-only teams, freelancers, and anyone who wants the shortest path from zero to a working Hyva store.

Xdebug side by side

Task Warden DDEV docker-magento
Debug a browser request Set XDEBUG_SESSION cookie ddev xdebug on, then load the page Set XDEBUG_SESSION cookie
Debug a CLI command warden debug, then run it ddev xdebug on, then ddev exec or ddev magento bin/debug-cli followed by the command
IDE port 9003 for Xdebug 3 9003 9003 (README lists 9000,9003)
Cost when not debugging None, separate container None once turned off None, separate container

In PhpStorm, the piece that most often fails is path mapping. The IDE needs to know that the project root on your machine corresponds to the webroot inside the container, usually /var/www/html. Without it, breakpoints are never hit even though the connection succeeds. When a debugging session works but your breakpoints are skipped, check the mapping before anything else.

Xdebug is for stepping through logic. For “why is this page slow”, a profiler is the better tool; our guide to profiling a slow Magento 2 request covers Blackfire, Xhprof, and New Relic.

Running Hyva Tailwind builds locally

Hyva’s CSS generation docs define the commands, run from the theme’s web/tailwind directory:

  • npm ci –ignore-scripts to install dependencies without running package lifecycle scripts.
  • npm run build for a production build, which writes styles.css to the theme’s web/css directory.
  • npm run watch while developing, with npm start as an alias on Hyva 1.4.0 and newer.
  • npm run browser-sync with a proxy to your local store URL for automatic reloads.

The docs also set Node versions by Hyva release: Node.js 20 for Hyva 1.4.0 and newer. If one developer builds with an older Node on their host and another uses the container’s Node, you can get different CSS output from the same code.

The bigger trap is where the build reads from. Tailwind scans template files, including templates in vendor modules, to decide which classes to keep. If you run npm on the host while vendor lives inside the container (or is mid-sync), the scan can miss files and drop classes that templates use. The symptom is a component that looks unstyled locally but fine on staging. docker-magento’s README calls this out and recommends always building inside the container. The same rule applies to Warden and DDEV: run the build in the web container (warden shell or ddev exec), or make sure the host copy of vendor is complete. Our article on the Hyva Tailwind production build goes deeper on content globs and safelists.

Settings that keep local close to production

Whichever tool you choose, a few habits prevent most “only fails on staging” bugs:

  • Pin versions in the repo. PHP, database, search engine, and Redis or Valkey versions should match production and live in the project’s environment config, not on each laptop.
  • Run in developer mode locally. Exceptions show on screen and generated code updates on the fly. Test production mode before release, because DI compilation catches errors developer mode hides; our explainer on Magento 2 deploy modes covers the differences.
  • Use a sanitized database. Never load an unmasked production dump onto a laptop. Customer names, emails, and addresses should be scrubbed before a copy leaves the server.
  • Catch all outgoing mail. Confirm order and password emails land in Mailcatcher, Mailpit, or the tool’s webmail, not real inboxes.
  • Turn Varnish on before release testing. Several cache bugs only appear when full page cache sits in front of PHP.

How we would choose

If your team… Start with
Works only on Magento and Hyva docker-magento
Works on Magento plus Shopware or Laravel, on macOS or Linux Warden
Works across many PHP platforms or has Windows developers DDEV
Already has one of these working well Keep it; switching costs more than it saves

The last row matters most. Every one of these tools can run a Hyva store well. Consistency across the team beats the theoretical edge of a different tool, so standardize on one, commit its config to the repo, and document the three commands a new developer needs. That handover discipline is part of how we run Hyva development services for clients.

Teams that also run other platforms may use other tooling for those. Shopify themes are built locally with Shopify CLI against a development store, as on our Shopify development projects. Shopware development fits naturally in Warden or DDEV, since both support it. BigCommerce development uses Stencil CLI for theme work rather than a full local server stack.

FAQ

Which is better for Magento 2, Warden or DDEV?

Warden is built around Magento and ships Varnish, RabbitMQ, and Redis in its magento2 environment, with cookie-triggered Xdebug. DDEV is a general PHP tool where Magento services come from add-ons, and it has the strongest Windows and WSL2 documentation. Magento-focused teams on macOS or Linux tend to prefer Warden; mixed-platform teams tend to prefer DDEV.

How do I enable Xdebug in docker-magento?

Set the XDEBUG_SESSION cookie in your browser, usually with the Xdebug Helper extension and the PHPSTORM key. Requests with the cookie go to the dedicated phpfpm-xdebug container. For CLI commands, use bin/debug-cli. The older bin/xdebug toggle is deprecated.

Why is my Hyva theme missing styles locally but fine on staging?

Usually the Tailwind build ran on the host and could not see every template, often in vendor, so it dropped classes. Run npm run build or watch inside the web container, use the right Node version for your Hyva release (Node.js 20 for 1.4.0 and newer), and check the content paths in your Tailwind config.

Can I develop Magento 2 on Windows?

Yes, through WSL2. DDEV documents WSL2 setup in detail, and docker-magento supports Windows through Docker on WSL. Keep the project files inside the WSL2 filesystem rather than on the Windows drive for usable performance.

Bemeir is a Brooklyn ecommerce agency that builds and supports Magento, Adobe Commerce, and Hyva storefronts; learn more about Bemeir, see our technology partners, or reach the team at Bemeir.

Let us help you get started on a project with Magento 2 Local Development Environments: Warden vs DDEV vs docker-magento, Xdebug Setup, and Running Hyva Builds Locally and leverage our partnership to your fullest advantage. Fill out the contact form below to get started.

more articles about ecommerce

Read on the latest with Shopify, Magento, eCommerce topics and more.