Rate this post

Part 4: Config Magento store using CLI

Welcome to our serial articles on Magento 2 Command Lines (CLI)!

You know Magento 2 has provided the powerful command-line interface tool (CLI). It allows you to perform tasks including installation, configuration, database backups, compiling LESS etc. Today I will show you how to manage the configuration of Magento store. Before starting this guide, please review our previous posts.

Commands in Magento 2 CLI
Commands in Magento 2 CLI

Config the Store

php bin/magento setup:store-config:set [–<parameter_name>=<value>, …]

This command allows you to change the config value of Magento Store. Let I show you the list of popular configuration below.

Parameter Description
–base-url Base Url of Magento store, for example: http://www.my-magento-store.com
–language The language to use in the Storefront and Backend, for example: en_US.

You can view the list of languages by using command:

php bin/magento info:language:list
–currency Default currency to use in the Storefront

php bin/magento info:currency:list
–timezone Default time zone to use in the Storefront and Backend

php bin/magento info:timezone:list
–use-rewrites
  • 1 means you use web server rewrites for generated links in the Storefront and Backend.
  • 0 do not use the web server rewrites. This is the default.
–use-secure
  • 1 enables the use of SSL in all URLs of Storefront and Backend
  • 0 do not use SSL with Magento. This is the default.
–base-url-secure Base secure url of Magento store. It will be used when you set use-secure = 1
–use-secure-admin
  • 1 means you use SSL to access the Backend.
  • 0 do not use SSL with the Backend. This is the default.

Your Magento website needs a powerful Magento ERP for stock control.

DON'T MISS THE CHANCE!

magento erp

How to Use All Commands in Magento 2 CLI - Part 3 Manage modules
How to Install Magento 2 on Ubuntu Server