{"id":195,"date":"2018-09-28T12:15:43","date_gmt":"2018-09-28T12:15:43","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2018\/09\/28\/setup-magento-2-multi-store\/"},"modified":"2025-06-11T13:03:46","modified_gmt":"2025-06-11T07:33:46","slug":"setup-magento-2-multi-store","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/setup-magento-2-multi-store\/","title":{"rendered":"How to Set Up Magento 2 Multi Store"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 supports creating multiple stores under a single admin panel. This can be useful for the growing brands to expand their business to more than one location.\u00a0Multi-store setup in Magento 2\u00a0helps in several ways, such as<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Easy administration of business through single configuration.<\/li>\n\n\n\n<li>Cost reduction for third-party modules and integrations.<\/li>\n\n\n\n<li>Retention of common customer database.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can create as many stores as you want in Magento 2, and manage them through a common admin panel. This can be pretty useful when you are taking your business global, and want to create a Magento 2 Multi-language store setup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are a Magento beginner, and lost in figuring out the differences between store and store view,&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/difference-between-website-store-store-view-in-magento-2\/\">check out this post<\/a>. You can&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/enable-magento-2-single-store-mode\/\">enable single store mode in Magento 2<\/a>&nbsp;when needed to turn off all store view options and scope indicators.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, find the complete stepwise method to&nbsp;<em><strong>set up Magento 2 Multi Store<\/strong><\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps to Set up Multiple Stores in Magento 2<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating multiple stores under single administration is possible in the Magento 2 platform. You can create multiple stores under single website, or create individual stores under different websites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, we are going to create a separate website for the new store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Simply log into your Magento 2 admin panel and follow these steps create your own Magento 2 multi-store site:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Create a New Website<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In the left menu, navigate to Store &gt; Settings &gt; All Stores. In the All Stores section, click on Create Website, and configure the following settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Name:<\/strong>&nbsp;Enter a name for the new website.<\/li>\n\n\n\n<li><strong>Code:<\/strong>&nbsp;Set a unique code for the fresh website.<\/li>\n\n\n\n<li><strong>Sort Order:<\/strong>&nbsp;Enter the sort order for the website, the default is \u20180\u2019. (Optional)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2018\/09\/1_Create-a-Website-1024x336.png\" alt=\"Create a website for setup multistore in Magento 2\" class=\"wp-image-3560\" style=\"width:840px;height:auto\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create a New Store<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s create a new Magento 2 store under the fresh website we created. Go to Store &gt; Settings &gt; All Stores, click Create Store, and configure the following settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Web Site:<\/strong>&nbsp;Choose the website that we created earlier. (This store will be created under the selected website)<\/li>\n\n\n\n<li><strong>Name:<\/strong>&nbsp;Enter a name for this store name. (For example: meetanshi)<\/li>\n\n\n\n<li><strong>Code:<\/strong>&nbsp;Set a unique code for this store.<\/li>\n\n\n\n<li><strong>Root Category:<\/strong>&nbsp;Choose the category for the store view.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2018\/09\/2_Create-New-Store-1024x387.png\" alt=\"Create a new store for multistore setup in Magento 2\" class=\"wp-image-3561\" style=\"width:840px;height:auto\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click the&nbsp;<strong>Save Store<\/strong>&nbsp;button to create a new store in Magento 2.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Create a New Store View<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, create a new Store View under the store we created earlier. To do that, go to Store &gt; Settings &gt; All Stores, and create a store view using the following settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Store:<\/strong>&nbsp;Select the store under which you want to create the new store view.<\/li>\n\n\n\n<li><strong>Name:<\/strong>&nbsp;Enter the name of the new store view. (For example: Meetanshi)<\/li>\n\n\n\n<li><strong>Code:<\/strong>&nbsp;Set a unique code for the store view.<\/li>\n\n\n\n<li><strong>Status:<\/strong>&nbsp;Choose enable to make the store view active.<\/li>\n\n\n\n<li><strong>Sort Order:<\/strong>&nbsp;Enter the sort order for the store view, the default is \u20180\u2019. (Optional)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2018\/09\/3_Create-New-StoreView-1024x441.png\" alt=\"Create a new store view in Magento 2 for multistore setup\" class=\"wp-image-3562\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click&nbsp;<strong>Save Store View&nbsp;<\/strong>button to savbe the store view.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Enable Developer Mode<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This step is optional if you already have developer mode enabled in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, provide access to the required directories using the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod -R a+wX var\n\nchmod -R a+wX app\/etc\n\nchmod -R a+wX pub\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, use the following command to enable developer mode in Magento 2:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bin\/magento deploy:mode:set developer\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can also enable developer mode in Magento 2 by replacing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAGE_MODE\u2019 =&gt; \u2018default\u2019 with MAGE_MODE\u2019 =&gt; \u2018developer\u2019 <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">in the&nbsp;<em><strong>app\/etc\/env.php<\/strong><\/em>&nbsp;file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Add index.php and .htaccess files<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new folder in the Magento 2 folder, i.e. demo5, and copy the index.php and .htaccess files from the root directory into it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the following code in the index.php file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nrequire realpath(__DIR__) . '\/..\/app\/bootstrap.php'; \/\/ path of root magento bootstrap.php\n$params = $_SERVER;\n$params[\\Magento\\Store\\Model\\StoreManager::PARAM_RUN_CODE] = 'base'; \/\/ change this with the code you chose in step. 4\n$params[\\Magento\\Store\\Model\\StoreManager::PARAM_RUN_TYPE] = 'website'; \/\/ store or website\n$bootstrap = \\Magento\\Framework\\App\\Bootstrap::create(BP, $params);\n$app = $bootstrap->createApplication('Magento\\Framework\\App\\Http');\n$bootstrap->run($app);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Create Base URL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, go to Stores &gt; Settings &gt; Configuration &gt; General &gt; Web, choose the website that we created in Step 1, expan the Base URLs and configure the following settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Base URL:<\/strong>&nbsp;Enter the base URL for the website.<\/li>\n\n\n\n<li><strong>Base Link URL:<\/strong>&nbsp;Enter the base link URL for the website.<\/li>\n\n\n\n<li><strong>Base URL for Static View Files(default value):<\/strong>&nbsp;Enter URL for static view files.<\/li>\n\n\n\n<li><strong>Base URL for User Media Files(default value):<\/strong>&nbsp;Enter URL for media files.Fill the same in the fields under Base URLs (Secure) if needed for \u2018https\u2019 access.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2018\/09\/4_Base-URLs-1024x415.png\" alt=\"Set the base URL of multistores in Magento 2\" class=\"wp-image-3563\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, click&nbsp;<strong>Save Config<\/strong>&nbsp;to save the settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Flush Magento 2 Cache<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In the end, flush the Magento 2 cache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to&nbsp;<strong>System &gt; Tools &gt; Cache Management<\/strong>&nbsp;and click&nbsp;<strong>Flush Magento Cache<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In case you are finding it challenging to create Magento 2 multi-store, you can always&nbsp;<a href=\"https:\/\/meetanshi.com\/hire-magento-developer.html\" target=\"_blank\" rel=\"noreferrer noopener\">hire Magento certified professionals<\/a>&nbsp;to do that for you. Our professionals are available to hire on a fixed hourly rate or on project basis.&nbsp;<a href=\"https:\/\/meetanshi.com\/contacts\" target=\"_blank\" rel=\"noreferrer noopener\">Contact us<\/a>&nbsp;with your requirements and one of the our executives will get back to you shortly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Do not forget to share this guide to set up Magento 2 multi store with your Magento friends via social media.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!!  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 supports creating multiple stores under a single admin panel. This can be useful for the growing brands to expand their business to more&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-195","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":16573,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/195\/revisions\/16573"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}