Log in to the Magento server as, or switch to, a user with permissions to write to the Magento file system. See switch to the Magento file system owner.
If you use the bash shell, you can 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
<magento_root>/binto your system
Because shells have differing syntax, consult a reference like unix.stackexchange.com.
Sample bash shell for CentOS:
Optionally, you can run the commands in the following ways:
cd <magento_root>/binand run them as
./magento <command name>
<magento_root>/bin/magento <command name>
<magento_root>is a subdirectory of your web server docroot.
In addition to the command arguments discussed here, see Common arguments.
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 Commerce Admin and the storefront, you must set all of the following parameters:
--use-secure: Set to
--base-url-secure: Set to a secure URL (that is, starting with
More details about these parameters can be found later in this topic.
Configure the lock
Configure a lock provider to prevent the launch of duplicate cron jobs and cron groups. (Requires Magento 2.2.5 and later 2.2.x versions or version 2.3.2 and later.)
Magento uses the database to save locks by default. If you have multiple nodes on your Magento Commerce servers, we recommend using Zookeeper as the lock provider.
If you are running Magento Commerce on the cloud infrastructure, you do not need to configure lock provider settings. Magento configures the file lock provider for Magento Commerce Pro projects during the provisioning process. See Cloud variables.
1 bin/magento setup:config:set [--<parameter_name>=<value>, ...]
||Lock provider name:
The default lock provider:
||The specific db prefix to avoid lock conflicts when using the
The default value:
||Host and port to connect to the Zookeeper cluster when you use the
|Yes, if you set
||The path where Zookeeper saves locks.
The default path is:
||The path where file locks are saved.||Yes, if you set