Magento 2 - Setup Multiple Websites/Stores on localhost

Keywords: Magento - Installers - How to - Domain Name (DNS)

I currently have my Magento Bitnami stack on an internal ip I have used the below command and I can access Magento storefront and admin perfectly fine.

sudo /opt/bitnami/configure_app_domain --domain

I want to add more websites in Magento and am wondering if I can do so just using an ip address. It seems that configurations with multiple websites call for a DNS address such as “”

I have tried configuring the app domain to “” and have added pointing to the static ip in the VM’s hosts file but when I try to access Magneto through a web browser is times out and references a failure to redirect from “” When I ping “” it does return “”.

I’d appreciate greatly it if you could point me in the right direction.


So I’ve been able to add more websites and access them using subdomains. With the Bitnami stack domain still configured at, I’ve added websites/stores/store views in Magento : – store code “website1” – store code “website2”

I’ve included entries in the host file of the host and guest OS:

The below article talks about adding code to the .htaccess file

It seems somewhat contradictory because the next article mentions adding the “SetEnvIf Host “ code to the .conf files in the Apache dir rather than the .htaccess file. Perhaps 1 article is a little bit older than the other.

I’ve added the “SetEnvIf Host” entries using the method’s described in the second link (Approach A).

All 3 sites load up fine. – Default Site – store code “base” – website1 – store code “website1” – website2 – store code “website2”

Since I have all this working perfectly, I would like the Default site to be “” as well.

When I try to change the domain to “” using the below command, add entries in the host file, and add the “SetEnvIf Host” host code in the “/opt/bitnami/apache2/conf/vhosts/htaccess/Magento-htaccess.conf” file and restart Apache, I can see the top and bottom frame of the website load then I type “” in a browser, but it does not load. It times out. I have cleared cookies/site data.

sudo /opt/bitnami/configure_app_domain --domain

So it looks like the problem is just now with the main “base” Magento website. When I switch everything back to “” it all works as described above. I should also note that the sub-domains still work when I change the configuration to “” Only the base website and admin page is not accessible.

Any help would be appreciated.

Hi @isaacabides,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

How to Run the Bitnami Support Tool in a cloud image or virtual machine

Please note that you need to paste the code ID that is shown at the end.


Hi Michiel,

I installed and ran the Bitnami Support Tool. The ID code is : 6ded6e7d-fbdd-eca7-eaad-c08672a3658d


Hi @isaacabides,

Can you try to configure the domain in the /etc/hosts file on your machine instead of the VM. Could you try that?


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.