
Please follow Magento Official documentation – https://devdocs.magento.com/guides/v2.4/install-gde/install-flow-diagram.html
For quick help below are the commands
PHP extensions
Magento Open Source:
- ext-bcmath
- ext-ctype
- ext-curl
- ext-dom
- ext-fileinfo
- ext-gd
- ext-hash
- ext-iconv
- ext-intl
- ext-json
- ext-libxml
- ext-mbstring
- ext-openssl
- ext-pcre
- ext-pdo_mysql
- ext-simplexml
- ext-soap
- ext-sockets
- ext-sodium
- ext-xmlwriter
- ext-xsl
- ext-zip
- lib-libxml
- lib-openssl
Adobe Commerce:
- ext-bcmath
- ext-ctype
- ext-curl
- ext-dom
- ext-fileinfo
- ext-gd
- ext-hash
- ext-iconv
- ext-intl
- ext-json
- ext-libxml
- ext-mbstring
- ext-openssl
- ext-pcre
- ext-pdo_mysql
- ext-simplexml
- ext-soap
- ext-sockets
- ext-sodium
- ext-spl
- ext-xmlwriter
- ext-xsl
- ext-zip
- lib-libxml
- lib-openssl
PHP OPcache
Get your authentication key by using composer – https://devdocs.magento.com/guides/v2.4/install-gde/prereq/connect-auth.html
Composer commands to install Magento 2
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
Create user and install
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
The following table summarizes the available commands. Commands are shown in summary form only. For more information about a command, click the link in the Command column.
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 |
More Commands on magento root directory
Magento Cheat sheet – https://www.beehexa.com/devdocs/magento-2-cli-commands-cheat-sheet/
Options:
--help (-h)
Display this help message--quiet (-q)
Do not output any message--verbose (-v|vv|vvv)
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug--version (-V)
Display this application version--ansi
Force ANSI output--no-ansi
Disable ANSI output--no-interaction (-n)
Do not ask any interactive question
Available commands:
help
Displays help for a commandlist
Lists commands
admin
admin:user:create
Creates an administratoradmin:user:unlock
Unlock Admin Account
cache
cache:clean
Cleans cache type(s)cache:disable
Disables cache type(s)cache:enable
Enables cache type(s)cache:flush
Flushes cache storage used by cache type(s)cache:status
Checks cache status
catalog
catalog:images:resize
Creates resized product imagescatalog:product:attributes:cleanup
Removes unused product attributes.
cron
cron:run
Runs jobs by schedule
customer
customer:hash:upgrade Upgrade customer's hash according to the latest algorithm
deploy
deploy:mode:set
Set application mode.deploy:mode:show
Displays current application mode.
dev
dev:source-theme:deploy
Collects and publishes source files for theme.dev:tests:run
Runs testsdev:urn-catalog:generate
Generates the catalog of URNs to *.xsd mappings for the IDE to highlight xml.dev:xml:convert
Converts XML file using XSL style sheets
i18n
i18n:collect-phrases
Discovers phrases in the codebasei18n:pack
Saves language packagei18n:uninstall
Uninstalls language packages
indexer
indexer:info
Shows allowed Indexersindexer:reindex
Reindexes Dataindexer:reset
Resets indexer status to invalidindexer:set-mode
Sets index mode typeindexer:show-mode
Shows Index Modeindexer:status
Shows status of Indexer
info
info:adminuri
Displays the Magento Admin URIinfo:backups:list
Prints list of available backup filesinfo:currency:list
Displays the list of available currenciesinfo:dependencies:show-framework
Shows number of dependencies on Magento frameworkinfo:dependencies:show-modules
Shows number of dependencies between modulesinfo:dependencies:show-modules-circular
Shows number of circular dependencies between modulesinfo:language:list
Displays the list of available language localesinfo:timezone:list
Displays the list of available timezones
maintenance
maintenance:allow-ips
Sets maintenance mode exempt IPsmaintenance:disable
Disables maintenance modemaintenance:enable
Enables maintenance modemaintenance:status
Displays maintenance mode status
module
module:disable
Disables specified modulesmodule:enable
Enables specified modulesmodule:status
Displays status of modulesmodule:uninstall Uninstalls modules installed by composer
sampledata
sampledata:deploy
Deploy sample data modulessampledata:remove
Remove all sample data packages from composer.jsonsampledata:reset
Reset all sample data modules for re-installation
setup
setup:backup
Takes backup of Magento Application code base, media and databasesetup:config:set
Creates or modifies the deployment configurationsetup:cron:run
Runs cron job scheduled for setup applicationsetup:db-data:upgrade
Installs and upgrades data in the DBsetup:db-schema:upgrade
Installs and upgrades the DB schemasetup:db:status
Checks if DB schema or data requires upgradesetup:di:compile
Generates DI configuration and all missing classes that can be auto-generatedsetup:install
Installs the Magento applicationsetup:performance:generate-fixtures
Generates fixturessetup:rollback
Rolls back Magento Application codebase, media and databasesetup:static-content:deploy
Deploys static view filessetup:store-config:set
Installs the store configurationsetup:uninstall
Uninstalls the Magento applicationsetup:upgrade
Upgrades the Magento application, DB data, and schema
theme
theme:uninstall
Uninstalls theme