Local Development Environments for Magento 2
The Challenge of Local Magento 2 Development
When we began our journey with Magento 2, one of our first challenges was establishing an efficient local development environment. Unlike simpler platforms, Magento 2 presents unique complexities for developers.
In the Magento 1 era, we could rely on a basic LAMP stack (Linux, Apache, MySQL, PHP) for our development needs. While functional, this approach became problematic when juggling multiple projects with different PHP version requirements - developers had to manually switch PHP versions between projects, a tedious and error-prone process.
Magento 2 significantly increased this complexity by requiring additional services:
- Elasticsearch/OpenSearch (mandatory from version 2.4 onward)
- Redis (for caching and session management)
- RabbitMQ (for message queues)
- Varnish (for full-page caching)
Installing these services directly on a developer’s machine creates several problems:
- Different projects often require different versions of these services
- Configuring multiple instances of services like Elasticsearch is impractical
- Switching between projects becomes increasingly complex
We needed a solution that would provide isolated environments for each project - environments that developers could easily configure, start, and stop as needed. So we conducted thorough research and consulted with the Magento community to find the optimal approach.
The most common approaches
After our research, we came up with the following list:
- Custom solution
- ddev
- docker-magento
- Docksal
- Valet+
- Warden
We also asked the community in 2020 and got the following answers back then:

The winner with around 40 % was docker-magento, followed by Valet+ with around 25 % and ddev with around 19 %. On the fourth place was Warden with around 17 %. Let’s take a look at them in detail.
Custom Solution
Pretty early in the process, we realized that a custom solution would be a bad idea for us. It requires a lot of time to set up and maintain, and in the end it would surely not be as mature as the other solutions. So we directly skipped this one.
ddev
ddev
is a Docker-based development environment maintained by Drud, a US based company.
It’s popular in general, not only in the Magento community. It’s written in Go and is easy to use and quick to set up.
As it has a big community and is well maintained, we gave it a try.
We liked the easy start, which spins up the needed Docker containers and services for you.
However, you had to add the services you need yourself. So instead of automatically coming with Opensearch or Varnish, you have to manually add and configure them. Also, it does not have any testing support out of the box for Magento tests.
docker-magento
This is surely one of the most popular solutions in the Magento community.
Even in our poll we could directly see that it is the most used solution.
It is a Docker-based development environment and written in bash and Docker.
docker-magento
is maintained by Mark Shust, who is a well-known Magento developer and trainer.
We gave it a try and found it really promising. Unfortunately, Magento 1 was no longer maintained. We still had some Magento 1 projects running, so we needed a solution that works for both Magento 1 and Magento 2.
Docksal
This approach is also Docker-based and maintained by the Docksal community. Although it’s not really popular in the Magento ecosystem, we gave it a try and tested it briefly. We found it easy to use and quick to set up. On the downside, only basic services such as the web server and database are included and configured by default. If you need additional services like Opensearch or RabbitMQ, you have to set them up and configure them yourself. It also has no official Magento 1 support and this way, it was not an option for us.
Valet+
Valet+ is a Laravel development environment. Interestingly, unlike most of the other solutions, it does not use Docker. Instead, it is based on Laravel Valet, which is a development environment for Mac minimalists. It’s actually very popular in the Magento community as you can see in the poll above. But as it only works for Mac and most of us are using Linux on our machines, we skipped this one as well.
Warden: Our Chosen Solution
After evaluating all options, we selected Warden as our preferred local development environment. Here’s why:
Key Features:
- Docker-based architecture - Built with standard Docker and Bash, making it reliable and transparent
- Active maintenance - With 440+ stars on GitHub and regular updates
- Pre-configured services - All Magento 2 required services available out-of-the-box
- Developer-friendly tools - Xdebug, Mailpit, and other development tools pre-configured
- Testing framework support - Full MFTF (Magento Functional Testing Framework) integration
- Multi-project compatibility - Works seamlessly with both Magento 1 and 2 projects
- Performance optimized XDebug support - Comes with two containers, one debug container with XDebug enabled and one without. Only if the XDebug cookie is set, the debug container is used. This makes sure, that you don’t have any performance impact, if you don’t need it.
Warden solved our core challenges by providing isolated environments with precisely matched service versions and simple project switching. Let’s look at how to set it up.
Setting Up Warden for Magento 2 Development
While the initial Warden setup requires a few steps, once configured, creating new projects becomes remarkably straightforward.
Install Warden
- Install Homebrew on your machine
- Install Docker
- Run the Docker post installation commands (Linux only)
- Install Docker Compose
- Install Warden >
brew install wardenenv/warden/warden
- Set up automatic DNS resolution
- Set up a trusted CA root certificate
That is it. Now let’s start our first project.
Create a new Magento2 project
- First start all the needed warden services with
warden svc up
. - Go to the project folder and run
warden env-init {{PROJECT_NAME}} magento2
to create a new Magento2 project. Replace{{PROJECT_NAME}}
with the name of your project. - This creates a new
.env
file, which defines the services and versions for your project, which looks like this:
WARDEN_ENV_NAME=my-project
WARDEN_ENV_TYPE=magento2
WARDEN_WEB_ROOT=/
TRAEFIK_DOMAIN=my-project.test
TRAEFIK_SUBDOMAIN=app
WARDEN_DB=1
WARDEN_ELASTICSEARCH=0
WARDEN_OPENSEARCH=1
WARDEN_ELASTICHQ=0
WARDEN_VARNISH=1
WARDEN_RABBITMQ=1
WARDEN_REDIS=1
OPENSEARCH_VERSION=2.12
MYSQL_DISTRIBUTION=mariadb
MYSQL_DISTRIBUTION_VERSION=10.6
NODE_VERSION=20
COMPOSER_VERSION=2
PHP_VERSION=8.3
PHP_XDEBUG_3=1
RABBITMQ_VERSION=3.13
REDIS_VERSION=7.2
VARNISH_VERSION=7.5
WARDEN_SYNC_IGNORE=
WARDEN_ALLURE=0
WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
WARDEN_TEST_DB=0
WARDEN_MAGEPACK=0
MAGEPACK_VERSION=2.11
BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=
In the first bigger section, you can decide, which services you need. If you don’t use RabbitMQ or Varnish, set them to 0 instead of 1.
In the next section you can define the versions of the services you need and make sure, that these fit the versions you will have in production.
The last sections are for testing and profiling. Let’s ignore them for now.
And now comes the magic part. You run warden env up
and Warden will spin up all the services you need for your project. You can call the project in your browser under https://app.my-project.test
and start coding.
Conclusion: Why Warden Works for Us
We’ve found Warden to be the most effective solution for our team’s needs. Here’s why we continue to use it:
- Project Isolation - Each project runs in its own environment with exactly the right service versions
- Easy Standardization - New team members can quickly set up consistent development environments
- Minimal Configuration - Most services work out-of-the-box with sensible defaults
- Production Matching - We can closely replicate production environments locally
- Performance - Docker-based solution with optimized configurations
- Community Support - Active development and responsive community
While each team’s needs are different, Warden has proven to be a robust solution for managing the complexity of Magento 2 development environments. We recommend giving it a try if you’re facing similar challenges with your Magento 2 projects. Thanks a lot to the Warden team for their great work and support!