Skip to content

Composer Install

Create new project

composer init

Configuration

The below options are required. You can see all options here.

Allow composer to apply patches to dependencies of magento-lts

composer config --json extra.enable-patching true

Configure Magento core composer installer to use magento-lts as the Magento source package

composer config extra.magento-core-package-type magento-source

Configure root directory that magento-lts will be installed to, such as pub, htdocs, or www

composer config extra.magento-root-dir pub

Require magento-core-composer-installer

For PHP 7 and 81

composer require "aydin-hassan/magento-core-composer-installer":"~2.0.0 || ^2.1.0"

Only for PHP 71

composer require "aydin-hassan/magento-core-composer-installer":"^2.0.0"

Only for PHP 81

composer require "aydin-hassan/magento-core-composer-installer":"~2.1.0"

Require magento-lts

Latest tagged v20 series release1

composer require "openmage/magento-lts":"^20.0.0"

Legacy v19 tagged release (Magento 1.9.4.x drop-in replacement supported until April 4, 2025)1

composer require "openmage/magento-lts":"^19.4.0"

Latest on main development branch1

composer require "openmage/magento-lts":"dev-main"

Latest on next development branch1

composer require "openmage/magento-lts":"dev-next"

Optimization

When deploying to a production environment, it’s recommended to optimize Composer’s autoloader to speed up classes lookup time:

composer dump-autoload --optimize

  1. Select y to trust magento-hackathon/magento-composer-installer or cweagans/composer-patches.