{"id":982,"date":"2021-12-06T18:15:49","date_gmt":"2021-12-06T16:15:49","guid":{"rendered":"https:\/\/plumrocket.com\/learn\/?p=982"},"modified":"2025-04-03T15:00:26","modified_gmt":"2025-04-03T12:00:26","slug":"how-to-install-magento-2-4-elasticsearch-varnish-with-docker","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker","title":{"rendered":"How to Install Magento 2.4 + ElasticSearch + Varnish with Docker"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full disable_zoom\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"600\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png\" alt=\"How to Install Magento 2.4 + ElasticSearch + Varnish with Docker\" class=\"wp-image-1517\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png 1600w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker-300x113.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker-1024x384.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker-768x288.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker-1536x576.png 1536w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker-1568x588.png 1568w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The following guide is our second tutorial dedicated to Magento installation with Docker. Whether you are just starting with Magento or a seasoned developer, you should be able to install Magento 2.4 in less than 30 minutes after reading the next simple eight steps.<\/p>\n\n\n\n<div class=\"wp-block-cover has-background-dim\" style=\"background-color:#f5f5f5;min-height:100px;aspect-ratio:unset;\"><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-dark-gray-color has-text-color wp-block-paragraph\">Need help with your Magento installation or any other Magento-related needs? Don&#8217;t hesitate to <a href=\"\/magento-development\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-primary-color\">reach out to us<\/span><\/a> for <span class=\"has-inline-color has-dark-gray-color\">expert development and support<\/span>.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Before you begin<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial requires you to have the Devilbox installed along with the Docker and Docker-compose in Ubuntu on Windows (WSL). Please follow our guide to <a href=\"\/learn\/devilbox-docker-wsl2\">install Magento on Docker with Devilbox<\/a> before you proceed to install Magento 2.4 using the next steps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Tools<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will be using the free <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Visual Studio Code<\/a> editor with <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=mikestead.dotenv\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">VSCode .env syntax highlighting<\/a> extension and new <a href=\"https:\/\/www.microsoft.com\/en-us\/p\/windows-terminal\/9n0dx20hk701\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Windows Terminal<\/a>.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Configure Docker for Magento 2.4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First, it&#8217;s important to make sure that our configuration file meets all <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.4\/install-gde\/system-requirements.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Magento 2.4 system requirements<\/a>. The following configuration will be set in the environment file:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Apache v2.4<\/li><li>PHP v7.4<\/li><li>MariaDB v10.4<\/li><li>ElasticSearch v7.9.3 (check the list of <a href=\"https:\/\/www.docker.elastic.co\/r\/elasticsearch\/elasticsearch-oss\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">all available versions<\/a>)<\/li><li>Varnish 6.x<\/li><li>RabbitMQ 3.8<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Open Devilbox environment file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd ~\/devilbox\/\nvi .env<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Comment out the Nginx web server line and uncomment Apache<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">HTTPD_SERVER=apache-2.4\n#HTTPD_SERVER=nginx-stable<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure that PHP version 7.4 is uncommented.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">#PHP_SERVER=7.3\nPHP_SERVER=7.4<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Enable Maria DB version 10.4<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">MYSQL_SERVER=mariadb-10.4\n#MYSQL_SERVER=mariadb-10.5<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We recommend disabling the \u201cxdebug\u201d PHP module to speed up your webserver and \u201cpsr\u201d PHP module to avoid errors during Magento Installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find and replace the \u201cPHP_MODULES_DISABLE\u201d value:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole,xdebug,psr<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Save changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Configure ElasticSearch, Varnish, and RabbitMQ for Magento 2.4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">According to Magento devdocs, ElasticSearch is required for Magento 2.4.x installation, and the other two services are recommended. However, we will install them all in this tutorial.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to add these services to the default Devilbox stack, we need to copy the <a href=\"https:\/\/docs.docker.com\/compose\/extends\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Docker Compose Override<\/a> configurations.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd ~\/devilbox\/\ncp compose\/docker-compose.override.yml-all docker-compose.override.yml<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Please note<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Optionally, you can remove extra services (like Blackfire, MailHog, Ngrok, etc.) from the new docker-compose override file (<a href=\"https:\/\/devilbox.readthedocs.io\/en\/latest\/configuration-files\/docker-compose-override-yml.html#docker-compose-override-yml\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>docker-compose.override.yml<\/strong><\/a>). However, this step can be skipped.<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s add new variables at the end of the Devilbox environment file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd ~\/devilbox\/\nvi .env<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><strong>Add settings for <\/strong><a href=\"https:\/\/devilbox.readthedocs.io\/en\/latest\/custom-container\/enable-elk-stack.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>ELK stack<\/strong><\/a><strong> (ElasticSearch, Logstash, and Kibana):&nbsp;<\/strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Copy &amp; paste these settings at the bottom of .env file.<\/em><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\"># ELK stack general\n# See here for all versions: https:\/\/www.docker.elastic.co\/\nELK_SERVER=7.9.3\n# Elastic Search settings\nHOST_PORT_ELK_ELASTIC=9200\n# Logstash settings\nHOST_PORT_ELK_LOGSTASH=9600\n# Kibana settings\nHOST_PORT_ELK_KIBANA=5601<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add settings for <a href=\"https:\/\/devilbox.readthedocs.io\/en\/latest\/custom-container\/enable-varnish.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Varnish Cache<\/a> &amp; HAProxy.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Copy &amp; paste these settings at the bottom of .env file.<\/em><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\"># Varnish version to choose\n#VARNISH_SERVER=4\n#VARNISH_SERVER=5\nVARNISH_SERVER=6\n\n# Varnish settings\nVARNISH_CONFIG=\/etc\/varnish\/default.vcl\nVARNICS_CACHE_SIZE=128m\nVARNISH_PARAMS=-p default_ttl=3600 -p default_grace=3600\nHOST_PORT_VARNISH=6081\n\n# HAProxy settings\nHOST_PORT_HAPROXY=8080\nHOST_PORT_HAPROXY_SSL=8443<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add settings for <a href=\"https:\/\/devilbox.readthedocs.io\/en\/latest\/custom-container\/enable-rabbitmq.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">RabbitMQ<\/a>.<br><\/strong>Copy &amp; paste these settings at the bottom of the <em>.env<\/em> file.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\"># RabbitMQ version to choose\n#RABBIT_SERVER=3.6\n#RABBIT_SERVER=3.6-management\n#RABBIT_SERVER=3.7\n#RABBIT_SERVER=3.7-management\n#RABBIT_SERVER=latest\n#RABBIT_SERVER=management\nRABBIT_SERVER=3.8\n\nRABBIT_DEFAULT_VHOST=my_vhost\nRABBIT_DEFAULT_USER=guest\nRABBIT_DEFAULT_PASS=guest\n\nHOST_PORT_RABBIT=5672\nHOST_PORT_RABBIT_MGMT=15672<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">3. Create DNS records in Windows &amp; Ubuntu<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the terminal, edit the Ubuntu hosts file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">sudo vi \/etc\/hosts<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Add this line and save changes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">127.0.0.1 my-magento24.loc<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Windows, open Notepad as administrator and edit the following file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">c:\\Windows\\System32\\Drivers\\etc\\hosts<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Add the same line as in Ubuntu and save changes:&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">127.0.0.1 my-magento24.loc<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Start the Docker &amp; create a new Virtual Host directory<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Start our docker containers in Ubuntu:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">sudo service docker start\ndocker-compose up<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Enter the PHP Docker container<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a new tab in the terminal and enter the following:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd ~\/devilbox\/\n.\/shell.sh<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Create a new Virtual Host directory<\/strong><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">mkdir my-magento24<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">5. Install Magento 2.4 with Docker<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to use the official <a href=\"https:\/\/devilbox.readthedocs.io\/en\/latest\/examples\/setup-magento2.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Devilbox documentation<\/a>,&nbsp; as your additional resource. We will add a couple of changes to the installation process.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Magento 2.4 using composer<\/h4>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd my-magento24\ngit clone https:\/\/github.com\/magento\/magento2\ncd magento2\ngit checkout 2.4.2\ncomposer install\ncomposer update<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Symlink webroot<\/h4>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd \/shared\/httpd\/my-magento24\/\nln -s magento2\/ htdocs<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Add MySQL Database<\/h4>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">mysql -u root -h 127.0.0.1 -p -e &#039;CREATE DATABASE my_magento24;&#039;<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Set file permissions<\/h4>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">cd \/shared\/httpd\/my-magento24\/htdocs\nfind var generated vendor pub\/static pub\/media app\/etc -type f -exec chmod g+w {} +\nfind var generated vendor pub\/static pub\/media app\/etc -type d -exec chmod g+ws {} +\nchmod u+x bin\/magento\n<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Testing ElasticSearch:&nbsp;<\/h4>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Tip:<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If needed, the default ElasticSearch IP address can be changed in your docker-compose.override.yml file.<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">To test if your ElasticSearch is working, just open the following URL in the browser: <a href=\"http:\/\/localhost:9200\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>http:\/\/localhost:9200<\/strong><\/a> or run this command in the terminal:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">curl -XGET &#039;172.16.238.240:9200&#039;<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You should receive a similar response to this:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">{\n  &quot;name&quot; : &quot;elastic&quot;,\n  &quot;cluster_name&quot; : &quot;docker-cluster&quot;,\n  &quot;cluster_uuid&quot; : &quot;mQ7yhl5NT1O8A3tcZGDjvg&quot;,\n  &quot;version&quot; : {\n    &quot;number&quot; : &quot;7.9.3&quot;,\n    &quot;build_flavor&quot; : &quot;oss&quot;,\n    &quot;build_type&quot; : &quot;docker&quot;,\n    &quot;build_hash&quot; : &quot;c4138e51121ef06a6404866cddc601906fe5c868&quot;,\n    &quot;build_date&quot; : &quot;2020-10-16T10:36:16.141335Z&quot;,\n    &quot;build_snapshot&quot; : false,\n    &quot;lucene_version&quot; : &quot;8.6.2&quot;,\n    &quot;minimum_wire_compatibility_version&quot; : &quot;6.8.0&quot;,\n    &quot;minimum_index_compatibility_version&quot; : &quot;6.0.0-beta1&quot;\n  },\n  &quot;tagline&quot; : &quot;You Know, for Search&quot;\n}<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Install Magento 2.4 using command line<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s use Magento 2 setup install command from the <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.4\/install-gde\/composer.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">official online guide<\/a>, with tiny changes :-):<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">bin\/magento setup:install \\\n--base-url=http:\/\/my-magento24.loc \\\n--db-host=127.0.0.1 \\\n--db-name=my_magento24 \\\n--db-user=root \\\n--admin-firstname=admin \\\n--admin-lastname=admin \\\n--admin-email=admin@admin.com \\\n--admin-user=admin \\\n--admin-password=admin123 \\\n--language=en_US \\\n--currency=USD \\\n--timezone=America\/New_York \\\n--use-rewrites=1 \\\n--backend-frontname=admin  \\\n--elasticsearch-host=172.16.238.240<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s how your Magento 2.4 frontend will look after a successful installation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1206\" height=\"673\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/10\/magento-2-4-frontend.png\" alt=\"Magento 2.4 frontend\" class=\"wp-image-1008\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/10\/magento-2-4-frontend.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/10\/magento-2-4-frontend-300x167.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/10\/magento-2-4-frontend-1024x571.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/10\/magento-2-4-frontend-768x429.png 768w\" sizes=\"auto, (max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We hope you found this article useful. If you have any difficulties, we are happy to help you with our <a href=\"https:\/\/plumrocket.com\/magento-development\">Magento Development services<\/a>. Please comment and share. Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following guide is our second tutorial dedicated to Magento installation with Docker. Whether you are just starting with Magento or a seasoned developer, you should be able to install Magento 2.4 in less than 30 minutes after reading the next simple eight steps.<\/p>\n<p>In this guide, we will be using the free Visual Studio Code editor with VSCode .env syntax highlighting extension and new Windows Terminal. <\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[126],"tags":[148,154,142,158,147],"class_list":["post-982","post","type-post","status-publish","format-standard","hentry","category-magento-setup","tag-docker","tag-elasticsearch","tag-magento-installation","tag-varnish","tag-wsl2","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Magento 2.4 Installation with Docker, Elasticsearch &amp; Varnish - Magento Tutorials for Beginners &amp; Professionals<\/title>\n<meta name=\"description\" content=\"Learn how to install Magento 2.4 with Docker, configure Elasticsearch for Magento 2, and set up Varnish Cache with Haproxy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/learn\/install-magento-24-docker\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2.4 Installation with Docker, Elasticsearch &amp; Varnish - Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"og:description\" content=\"Learn how to install Magento 2.4 with Docker, configure Elasticsearch for Magento 2, and set up Varnish Cache with Haproxy.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/learn\/install-magento-24-docker\" \/>\n<meta property=\"og:site_name\" content=\"Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-06T16:15:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T12:00:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png\" \/>\n<meta name=\"author\" content=\"Oleh Lutsiv\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleh Lutsiv\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2.4 Installation with Docker, Elasticsearch & Varnish - Magento Tutorials for Beginners &amp; Professionals","description":"Learn how to install Magento 2.4 with Docker, configure Elasticsearch for Magento 2, and set up Varnish Cache with Haproxy.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker","og_locale":"en_US","og_type":"article","og_title":"Magento 2.4 Installation with Docker, Elasticsearch & Varnish - Magento Tutorials for Beginners &amp; Professionals","og_description":"Learn how to install Magento 2.4 with Docker, configure Elasticsearch for Magento 2, and set up Varnish Cache with Haproxy.","og_url":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker","og_site_name":"Magento Tutorials for Beginners &amp; Professionals","article_published_time":"2021-12-06T16:15:49+00:00","article_modified_time":"2025-04-03T12:00:26+00:00","og_image":[{"url":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png","type":"","width":"","height":""}],"author":"Oleh Lutsiv","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oleh Lutsiv","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#article","isPartOf":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker"},"author":{"name":"Oleh Lutsiv","@id":"https:\/\/plumrocket.com\/learn\/#\/schema\/person\/220a8bb9a1a74594fce18c169715d98c"},"headline":"How to Install Magento 2.4 + ElasticSearch + Varnish with Docker","datePublished":"2021-12-06T16:15:49+00:00","dateModified":"2025-04-03T12:00:26+00:00","mainEntityOfPage":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker"},"wordCount":636,"commentCount":0,"image":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#primaryimage"},"thumbnailUrl":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png","keywords":["docker","elasticsearch","magento installation","varnish","wsl2"],"articleSection":["Magento Setup"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/plumrocket.com\/learn\/install-magento-24-docker#respond"]}]},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker","url":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker","name":"Magento 2.4 Installation with Docker, Elasticsearch & Varnish - Magento Tutorials for Beginners &amp; Professionals","isPartOf":{"@id":"https:\/\/plumrocket.com\/learn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#primaryimage"},"image":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#primaryimage"},"thumbnailUrl":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png","datePublished":"2021-12-06T16:15:49+00:00","dateModified":"2025-04-03T12:00:26+00:00","author":{"@id":"https:\/\/plumrocket.com\/learn\/#\/schema\/person\/220a8bb9a1a74594fce18c169715d98c"},"description":"Learn how to install Magento 2.4 with Docker, configure Elasticsearch for Magento 2, and set up Varnish Cache with Haproxy.","breadcrumb":{"@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/learn\/install-magento-24-docker"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#primaryimage","url":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png","contentUrl":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/08\/install-magento-2-4-with-docker.png","width":1600,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/learn\/install-magento-24-docker#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Learn","item":"https:\/\/plumrocket.com\/learn"},{"@type":"ListItem","position":2,"name":"How to Install Magento 2.4 + ElasticSearch + Varnish with Docker"}]},{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/learn\/#website","url":"https:\/\/plumrocket.com\/learn\/","name":"Magento Tutorials for Beginners &amp; Professionals","description":"Plumrocket Inc","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/learn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/plumrocket.com\/learn\/#\/schema\/person\/220a8bb9a1a74594fce18c169715d98c","name":"Oleh Lutsiv","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/12\/avatar_user_5_1638723754-96x96.jpg","url":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/12\/avatar_user_5_1638723754-96x96.jpg","contentUrl":"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/12\/avatar_user_5_1638723754-96x96.jpg","caption":"Oleh Lutsiv"},"description":"Founder of Plumrocket Inc, obsessed with web performance and crafting innovative solutions in the eCommerce industry. When not in programming and managing, he enjoys fishing, winter, and family time.","url":"https:\/\/plumrocket.com\/learn\/author\/oleh"}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":37,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":2377,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/982\/revisions\/2377"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}