Magento 2 Installation Guide

Magento 2 Installation Guide

Install Elasticsearch before installing Adobe Commerce or Magento Open Source 2.4.0

Get the metapackage

composer create-project –repository-url= magento/project-community-edition <install-directory-name>

Set file permissions

cd /var/www/html/<magento install directory> find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + chown -R :www-data . # Ubuntu chmod u+x bin/magento

Install Magento

bin/magento setup:install \ –base-url=http://localhost/magento2ee \ –db-host=localhost \ –db-name=magento \ –db-user=magento \ –db-password=magento \ –admin-firstname=admin \ –admin-lastname=admin \ – \ –admin-user=admin \ –admin-password=admin123 \ –language=en_US \ –currency=USD \ –timezone=America/Chicago \ –use-rewrites=1 \ –search-engine=elasticsearch7 \ – \ –elasticsearch-port=9200 \ –elasticsearch-index-prefix=magento2 \ –elasticsearch-timeout=15

Command summary
To display a complete list of commands, enter:

bin/magento list
To get help for a particular command, enter:

bin/magento help <command>
For example,

bin/magento help setup:install
bin/magento help cache:enable

magento setup:installInstalls the Magento softwareNone
magento setup:uninstallRemoves the Magento software.Magento software installed
magento setup:upgradeUpdates the Magento software.Deployment configuration
magento maintenance:{enable/disable}Enables or disables maintenance mode (in maintenance mode, only exempt IP addresses can access the Admin or storefront).Magento software installed
magento setup:config:setCreates or updates the deployment configuration.None
magento module:{enable/disable}Enable or disable modules.None
magento setup:store-config:setSets storefront-related options, such as base URL, language, timezone, and so on.Deployment configuration
Database (simplest way is to use magento setup:upgrade)
magento setup:db-schema:upgradeUpdates the Magento database schema.Deployment configuration
magento setup:db-data:upgradeUpdates the Magento database data.Deployment configuration
magento setup:db:statusChecks if the database is up-to-date with the code.Deployment configuration
magento admin:user:createCreates a Magento administrator.All of the following:

Deployment configuration

Enable at minimum the Magento_User and Magento_Authorization modules

Database (simplest way is to use magento setup:upgrade)

magento listLists all available commands.None
magento helpProvides help for the specified command.None

Source: Quick start install Installation flow Adobe Commerce 2.4 Developer Guide