I've a project which contains magento 2 core files and a few custom modules. Now I'm trying to install Magento.

During magento installation I see all custom modules are getting installed.

I don't want these modules to be installed during Magento installation.

Later based on necessity I want to install those modules.

How to achieve it?

  • 1
    How you are Installing the Magento 2 Instance via command line or browser?
    – Keyur Shah
    May 8, 2018 at 8:45
  • @KeyurShah Bhai I think he is installing from browser May 8, 2018 at 8:59
  • in that case your answer seems good option as of now nothing interesting in mind :) @MurtuzaZabuawala
    – Keyur Shah
    May 8, 2018 at 9:05
  • @KeyurShah I gotta hint from my answer's comment from him May 8, 2018 at 9:08
  • Yes, I'm installing it from browser.
    – amitshree
    May 8, 2018 at 9:49

3 Answers 3


If you don't want to follow @Divyesh steps

Then you can do following

at the time of installation

in step 4(Step 4: Customize Your Store)

Click on Advanced module configuration

and un-select modules that you don't want to install

Update as per OP's requirement

Go to app/etc/NonComposerComponentRegistration.php file

and comment below code

$pathList[] = dirname(__DIR__) . '/code/*/*/registration.php';

your app/code module will not autometically load

but after this if you want to install your app/code module then you have to uncomment this line

  • Thats helpful. Though this repo is going to be used my multiple developers and generally we don't expand Advanced tab and unselect modules during magento installation. Is it possible to achieve it by modifying some code to avoid manual unselection?
    – amitshree
    May 8, 2018 at 7:18
  • @amitshree in that case you can create that config.php file with status 0 May 8, 2018 at 8:31
  • This repo will be used across multiple projects and based on project different custom modules will be used (so different config.php file). I was looking for a solution if it's possible to control it on code level mentioning dependency. Is that possible or I've to manually update config.php for each project?
    – amitshree
    May 8, 2018 at 10:08
  • @amitshree check updated answer May 8, 2018 at 11:14
  • 1
    @amitshree just comment this line 0 => __DIR__ . '/../..' . '/app/code' May 8, 2018 at 12:01
  • If your source code has app/etc/config.php file available then just disable modules which you don't want to include in installation.

For EX:

 'Package_CustomModule' => 1,

Replace with

 'Package_CustomModule' => 0,

if you don't have app/etc/config.php Go to your custom module and remove your custom module folders

  • 2
    app/etc/config.php is created during project install so disabling modules through this file is not possible and I want to keep these custom modules in my repo and install/enable required custom modules after magento is installed.
    – amitshree
    May 8, 2018 at 6:41

If you do not want to install custom module while Magento installation, rename module registration.php file.

Now you can install Magento without installing the custom module.

correct module registration.php file when you want to install custom module.

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.