What is the best way to Configure Docker environment with Magento 2.4. If some know please give me a solution.

7 Answers 7


You can use these files to setup you docker environment easy to use visit link - https://github.com/markoshust/docker-magento

I hope so it will help you.


You can use the following docker image


, it is already optimized to run magento 2.4.

Although you will also need elasticsearch 7


I would prefer solution provided by Warden - https://warden.dev.

Good documentation, extremely simple to install with different services for different projects, support of local domains for development.


I use MeanBee docker for Magento 2: https://github.com/meanbee/docker-magento2 I hope this will help you.


You can use these repo https://github.com/echo-magento/docker-magento2


  • Magento 2.4
  • Apache
  • PHP 7.1, PHP 7.2, PHP 7.3
  • Xdebug
  • Composer 1.10.17
  • MariaDB 10.4.13
  • Elasticsearch 7.6
  • Varnish 6.4
  • Redis
  • MailHog
  • n98-magerun
  • Project directory "/var/www/html/." is not empty. error on install magento Oct 15, 2021 at 8:39

If you use https://github.com/echo-magento/docker-magento2 and get the error message "Project directory "/var/www/html/." is not empty", you might have forgotten to remove index.php.

From the documentation:

To install the latest version of Magento 2:

rm index.php

P.S. I would have liked to comment on Hamendra Sunthwal's comment, unfortunately I cannot comment yet.


here is another #docker configuration for Magento 2.4.4


Stack components in use:

  • MariaDB - high performing open source relational database, forked from MySQL.
  • Nginx - Official build of Nginx.
  • PHP 8.1 - PHP scripting language.
  • Varnish - is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs.
  • ElasticSearch - is a powerful open source search and analytics engine that makes data easy to explore.
  • Redis x2 - key-value store that functions as a data structure server.
  • RabbitMQ - is an open source multi-protocol messaging broker.
  • NodeJS - is a JavaScript-based platform.
  • PHPMyAdmin - a web interface for MySQL and MariaDB.
  • Certbot - Official build of EFF's Certbot tool for obtaining TLS/SSL certificates from Let's Encrypt.
  • [Composer]
  • [Cron]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.