mage create
Create a new project, install it and set it up, in a new folder.
mage create my-shop
mage create my-shop --edition=community --version=2.4.8 --env=warden
mage create my-shop -y
| Option | Does |
|---|---|
--edition=EDITION |
mage-os, community or enterprise, defaults to MAGE_EDITION (mage-os) |
--version=VERSION |
The Magento version, defaults to latest |
--env=ENV |
warden, ddev, valet or local, defaults to the first one installed |
-y, --yes |
Use the defaults for anything not given, instead of asking |
Anything not given as an option is asked. The name is a folder name, and must not exist yet.
Steps
- Creates the composer project, in the chosen environment. Warden and DDEV first set up and start their containers.
- Configures composer for development:
minimum-stabilitydev withprefer-stable, and allows the composer patches plugin. - Registers the
package-sourcefolder as a composer path repository, for your local packages. It gets a.gitkeep, so the folder survives a clone, whichcomposer installneeds. - Requires the default packages from
MAGE_PACKAGESandMAGE_DEV_PACKAGES, see configuration, and runscomposer install. - Runs the setup below.
Edition community and enterprise need your Magento marketplace keys in the composer auth.
mage setup
Install Magento in an existing project, which is also how a project is reinstalled.
mage setup # in the project
mage setup my-shop # from the parent folder
When Magento is already installed, it asks first, as this drops the database.
Steps
- Prepares the services, depending on the environment: creates the database for local and Valet, secures the site with Valet or signs the certificate with Warden.
- Runs
setup:install, with the database, OpenSearch and Redis of the environment. The admin url is<project>_admin, the store urlhttps://<project>.<MAGE_DOMAIN>/. - Gives OpenSearch and the Redis caches a prefix named after the database, so projects sharing a service stay apart.
- Sets the store name and the store config from
MAGE_STORE_CONFIG. - Sets the developer mode, and disables the modules in
MAGE_DISABLE_MODULESthe install has: two factor authentication, and on Mage-OSMageOS_ThemeOptimization, whose bfcache conflicts with the BFCache patches and does not work with Hyvä, see mage-os/module-theme-optimization#28. - Writes the
.valet-env.phpwith Valet. - Moves the
*.samplefiles of the root todev/sample-files, and adds a.gitignorewhen the project has none.
At the end it shows the store and admin url, with the admin user and password.