Commerce has one command-line interface (CLI)—<magento_root>/bin/magento
—that runs installation and configuration tasks, including:
Additional benefits include:
<magento_root>/bin/magento list
) lists all available installation and configuration commands.This topic discusses configuring the Adobe Commerce and Magento Open Source software using the CLI. For information about installing Commerce, see Installation flow in the Installation guide.
Before you begin using the CLI, make sure that:
For the bash shell, use the following syntax to switch to the file system owner and enter the command at the same time:
su <file system owner> -s /bin/bash -c <command>
If the file system owner does not allow logins, you can use the following:
sudo -u <file system owner> <command>
To run CLI commands from any directory:
Add <magento_root>/bin
to your system PATH
.
Sample bash shell for CentOS:
export PATH=$PATH:/var/www/html/magento2/bin
Optionally, you can run the following:
cd <magento_root>/bin
and run them as ./magento <command name>
<magento_root>/bin/magento <command name>
<magento_root>
is a subdirectory of your web server docroot