Set configuration values on your production system
This section discusses how to set sensitive values on your production system using the magento config:sensitive:set
command.
To set sensitive values:
-
Find a value to set using the sensitive value reference.
-
Note the configuration path for the setting.
-
Log in to the production system as, or switch to, the file system owner.
-
Change to the Commerce installation directory.
-
Enter the following command:
bin/magento config:sensitive:set {configuration path} {value}
For example, to set the value of the YouTube API key to
1234
, enterbin/magento config:sensitive:set catalog/product_video/youtube_api_key 1234
You can also set one or more values interactively as follows:
bin/magento config:sensitive:set -i
When prompted, enter a value for each sensitive setting or press Enter to skip a value and move to the next one.
-
To verify that the value was set, log in to the Admin.
-
Locate the setting in the Admin.
For example, the YouTube API key setting is located in Stores > Settings > Configuration > Catalog > Catalog > Product Video.
The setting is displayed in the Admin and cannot be edited. The following figure shows an example.