How to install 2 x magento instances on one dedicated server

Hi Craig,

I’m thinking about installing 2 Magento installation on one dedicated powerful server.

Could you please tell me how to configure my server?

I would like to have something like

root user disabled
1st magento
superuser1 i.e pawel
apache, php, mysql, elasticsearch
magento user1: magento

2nd magento
superuser2: i.e. daniel
apache, php, mysql, elasticsearch
magento2 user: magento 2

Thank you.

OS Users

Create them like you normally would.


Install it like you normally would.


Install it like you normally would


Configuring “Apache Virtual Hosts”, you’ll find tons of tutorials on Google. This will allow you to configure different URLs to access different web directories. For example:

  • >> /var/www/example_one
  • >> /var/www/example_two

It’s super-simple to setup. I even touched on the concept slighty during the Multi-Domain tutorial.


Install it like you normally would. Obviously, replace references of /var/www/html/ with the appropriate directory that you’ve created for your own instance.

Everything else

As for Elasticsearch, Redis, Varnish and stuff like that I’ve no idea how to configure those for multiple instances on the same server. They’ll all need extra configuration that I’ve never even tried before.


Excellent. It helped.
On my old production server when I had 2 site I had Cpannel installed and from what I remember I could have 2 different versions of php.

I’ll play with it.
Have a good weekend.

1 Like

Hi Craig,

I’m fighting with installing Mag2.4.
There are issues as always. I think it is due to the composer v2 which was installed automatically.
I don’t think that it will be a big one. Can you tell me how to bike it?

 Problem 1
 - Root composer.json requires magento/composer-root-update-plugin ~1.0 -> satisfiable by magento/composer-root-update-plugin[1.0.0].
 - magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not matc           h the constraint.
 Problem 2
 - Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-comp           oser-installer[v0.5.0].
 - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it d           oes not match the constraint.
 Problem 3
 - laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it doe           s not match the constraint.
 - magento/product-community-edition 2.4.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency           -plugin[1.0.0, ..., 1.0.4].
 - Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-is sue to ask them to support Composer 2.

I did it.

I downgraded the composer to 1.10.10 by running the command.

composer self-update 1.10.10



I think Im on the last step to install M2.4.1 running the Magento installation script

bin/magento setup:install \
--base-url= \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password="U274eeGzNCqKJ2LpvtS@329" \
--admin-firstname=bob \
--admin-lastname=smith \
[email protected] \
--admin-user=bob \
--admin-password=example@123 \
--language=en_US \
--currency=GBP \
--timezone=Europe/London \

But for some reasons I get a message that --db-host=localhost: command not found :rage:

What is wrong? I don’t think I omitted any step during the server config.
Please give me a tip.

Thank you in advance.

I have to admit that installing M2.3 was much easier.
(after installing it maybe 50 times :slight_smile:)

I also get this.

I’ve got it. it was so easy. I had to close my email address and everything what contains special characters in apostrophises.

Worth to remember. Plus issue with composer v.2.

It may save others time :slight_smile:

Thanks for the update. I just posted a new Issue/Solution about Composer 2.x (Root composer.json requires magento/composer-root-update-plugin) to help others with what you’ve found.

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