Configure the store
First steps
-
Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.
If you use the bash shell, you can also use the following syntax to switch to the Magento file system owner and enter the command at the same time:
su <Magento file system owner> -s /bin/bash -c <command>
If the Magento file system owner does not allow logins you can do the following:
sudo -u <Magento file system owner> <command>
-
To run Magento commands from any directory, add
<your Magento install dir>/bin
to your systemPATH
.Because shells have differing syntax, consult a reference like unix.stackexchange.com.
bash shell example for CentOS:
export PATH=$PATH:/var/www/html/magento2/bin
You can also run the commands in the following ways:
cd <your Magento install dir>/bin
and run them as./magento <command name>
php <your Magento install dir>/bin/magento <command name>
<your Magento install dir>
is a subdirectory of your web server's docroot. Need help locating the docroot? Click here.
In addition to the command arguments discussed here, see Common arguments.
Prerequisites
Before you run this command, you must do all of the following or you must install the Magento software:
Completely secure installation
To use Secure Sockets Layer (SSL), also referred to as HTTPS, for both the Magento Admin and the storefront, you must set all of the following parameters:
--use-secure
: Set to1
--base-url-secure
: Set to a secure URL (that is, starting withhttps://
)--use-secure-admin
Set to1
More details about these parameters can be found later in this topic.
Configure the store
Command usage:
magento setup:store-config:set [--<parameter_name>=<value>, ...]
where the following table defines parameters and values.
Name | Value | Required? |
---|---|---|
--base-url | Base URL to use to access your Magento Admin and storefront in any of the following formats:
|
No |
--language | Language code to use in the Admin and storefront. (If you have not done so already, you can view the list of language codes by entering |
No |
--currency | Default currency to use in the storefront. (If you have not done so already, you can view the list of currencies by entering |
No |
--timezone | Default time zone to use in the Admin and storefront. (If you have not done so already, you can view the list of time zones by entering magento info:timezone:list from the bin directory.) |
No |
--use-rewrites |
|
No |
--use-secure |
|
No |
--base-url-secure | Secure base URL to use to access your Magento Admin and storefront in the following format:
http[s]://<host or ip>/<your Magento install dir>/ |
No |
--use-secure-admin |
|
No |
Related topics
- Installing the Magento software using the command line
- Remove sample data modules or update sample data
- Enable or disable modules
- Display or change the Admin URI
- Uninstall modules
- Create or update the deployment configuration
- Enable or disable maintenance mode
- Create the Magento database schema
- Update the Magento database schema and data
- Create or unlock a Magento administrator
- Back up and roll back the file system, media, and database
- Uninstall themes
- Uninstall language packages
- Uninstall the Magento software
- Update the Magento software
- Reinstall the Magento software