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=https://repo.magento.com/ 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-email=admin@admin.com \ –admin-user=admin \ –admin-password=admin123 \ –language=en_US \ –currency=USD \ –timezone=America/Chicago \ –use-rewrites=1 \ –search-engine=elasticsearch7 \ –elasticsearch-host=es-host.example.com \ –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

COMMAND DESCRIPTION PREREQUISITES
magento setup:install Installs the Magento software None
magento setup:uninstall Removes the Magento software. Magento software installed
magento setup:upgrade Updates 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:set Creates or updates the deployment configuration. None
magento module:{enable/disable} Enable or disable modules. None
magento setup:store-config:set Sets 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:upgrade Updates the Magento database schema. Deployment configuration
magento setup:db-data:upgrade Updates the Magento database data. Deployment configuration
magento setup:db:status Checks if the database is up-to-date with the code. Deployment configuration
magento admin:user:create Creates 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 list Lists all available commands. None
magento help Provides help for the specified command. None

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