Contents
See one of the following sections:
- Before you configure the Magento application
- First steps
- Command summary
- Help commands
- Common arguments
- Commands
Before you configure the Magento application
Before you begin, make sure that:
- Your system meets the requirements discussed in Magento System Requirements.
- You completed all prerequisite tasks discussed in Prerequisites.
- After you log in to the Magento server, switch to a user that has permissions to write to the Magento file system. One way to do this is discussed in switch to the Magento file system owner.
First steps
- Log in to the Magento server as, or switch to, the Magento file system owner.
- Change to the following directory:
cd <your Magento install dir>/bin
Examples:- Ubuntu:
cd /var/www/magento2/bin
- CentOS:
cd /var/www/html/magento2/bin
- Ubuntu:
You can run the commands in any of the following ways:
php magento <command>
magento <command>
Command summary
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.
Before you run any of these commands, you must either install the Magento application or enable some modules.
Command | Description |
---|---|
magento setup:cache:{enable|disable|clean|flush|status} | Manages the cache |
magento setup:indexer:{status|show-mode|set-mode|reindex|info} | Manages the indexers |
magento cron:run | Runs Magento cron jobs |
magento setup:di:compile-multi-tenant | Use only if you have multiple independent Magento applications (in other words, one common Magento code base but more than one independent instance of the Magento application). Compiles all non-existent proxies and factories; and pre-compiles class definitions, inheritance information, and plugin definitions for multiple stores or websites. |
magento setup:di:compile | Use if you have one instance of the Magento application. Compiles all non-existent proxies and factories; and pre-compiles class definitions, inheritance information, and plugin definitions for one store and website. |
magento info:dependencies:{show-modules|show-modules-circular|show-framework}e | Module dependencies, circular dependencies, and Magento framework dependencies. |
magento i18n:{collect-phrases|pack} | Creates a translation dictionary or a translation package |
magento setup:static-content:deploy | Deploys static view files |
magento dev:source-theme:deploy | Creates CSS from LESS |
magento dev:tests:run | Runs automated tests |
magento dev:xml:convert | Update your layout XML files to match the new Extensible Stylesheet Language Transformations (XSLT) stylesheet |
magento setup:perf:generate-fixtures | Generate data to use for performance testing. |
magento sampledata:install | Installs optional Magento sample data after you install the Magento application. For more details about Magento sample data, see Optional Magento sample data. |
Help commands
To display a complete list of commands, enter:
magento --list
To get help for a particular command, enter:
magento --help <command>
For example,
magento --help setup:install magento --help cache:enable
Common arguments
The following arguments are common to all commands. These commands can be run either before or after the Magento software is installed:
Long version | Short version | Meaning |
---|---|---|
--help | -h | Get help for any command. For example, ./magento help setup:install or ./magento help setup:config:set . |
--quiet | -q | Quiet mode; no output. |
--no-interaction | -n | No interactive questions. |
--verbose=1|2|3 | -v|vv|vvv | Verbosity level. For example, --verbose=3 or -vvv displays debug verbosity, which is the most verbose output. Default is --verbose=1 or -v . |
--version | -V | Display this application version |
--ansi | n/a | Force ANSI output |
--no-ansi | n/a | Disable ANSI output |
Commands
The following sections discuss the available commands.
- Manage the cache
- Manage the indexers
- Configure and run cron
- Code compiler
- Set the Magento mode
- URN highlighter
- Dependency reports
- Translation dictionaries and language packages
- Deploy static view files
- Create symlinks to LESS files
- Run unit tests
- Convert layout XML files
- Generate data for performance testing
Find us on