Create or update the deployment configuration
There are no prerequisites for using this command.
Create or update the deployment configuration
Deployment configuration provides the information that the application needs to initialize and bootstrap.
You can use this command if:
- You previously installed the application and you want to modify the deployment configuration
- You want to create only the deployment configuration and continue the installation some other way
- To update the deployment configuration without affecting anything else
Command options:
bin/magento setup:config:set [--<parameter>=<value>, ...]
The following table discusses the meanings of installation parameters and values.
--backend-frontname
To prevent exploits, we recommend you not use a common word like admin, backend. The Admin URI can contain alphanumeric values and the underscore character (
_
) only.--db-host
- The database server’s fully qualified hostname or IP address.
-
localhost
(default) or 127.0.0.1
if your database server is on the same host as your web server. localhost means the MySQL client library uses UNIX sockets to connect to the database. 127.0.0.1
causes the client library to use the TCP protocol. For more information about sockets, see the PHP PDO_MYSQL documentation.Note: You can optionally specify the database server port in its hostname like
www.example.com:9000
--db-name
Default is
magento2
.--db-user
Default is
root
.--db-password
--db-prefix
In that case, use a prefix to identify the tables for this installation. Some customers have more than one Adobe Commerce or Magento Open Source instance running on a server with all tables in the same database.
The prefix can be a maximum of five characters in length. It must begin with a letter and can include only letters, numbers, and underscore characters.
This option enables those customers to share the database server with more than one Adobe Commerce or Magento Open Source installation.
--session-save
-
db
to store session data in the database. Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.-
files
to store session data in the file system. File-based session storage is appropriate unless the file system access is slow, you have a clustered database, or you want to store session data in Redis.-
redis
to store session data in Use Redis for session storage. If you are using Redis for default or page caching, Redis must be already installed.--key
--db-init-statements
Default is
SET NAMES utf8;
.Consult a reference similar to this one before you set any values.
--http-cache-hosts
Format must be
<hostname or ip>:<listen port>
, where you can omit <listen port>
if it’s port 80. For example, --http-cache-hosts=192.0.2.100,192.0.2.155:6081
. Do not separate hosts with a space character.Import configuration data
When setting up a production system, it’s good practice to import configuration settings from config.php
and env.php
into the database.
These settings include configuration paths and values, websites, stores, store views, and themes.
After importing websites, stores, store views, and themes, you can create product attributes and apply them to websites, stores, and store views, on the production system.
On the production system, run the following command to import data from the configuration files (config.php
and env.php
) to the database:
bin/magento app:config:import [-n, --no-interaction]
The optional [-n, --no-interaction]
flag allows the command to run without additional confirmations.
For additional information, please, check the Import data from configuration files
Sensitive data
Adobe Commerce and Magento Open Source use your encryption key to encrypt the following:
- Credit card information
- Usernames and passwords specified in the Admin configuration (for example, logins to payment gateways)
- CAPTCHA values sent over the network
Adobe Commerce and Magento Open Source do not encrypt:
- Administrative and customer usernames and passwords (these passwords are hashed)
- Address
- Phone number
- Other types of personally identifiable information except for credit card numbers