Magento application environment variables

The following table lists variables that you can override using environment variables.

Variable name Description Default value
ADMIN_USERNAME User name for a Magento administrative user. This user is an administrator and can create other users, including other administrative users. admin
ADMIN_FIRSTNAME Administrative user's first name. John
ADMIN_LASTNAME Administrative user's last name. Doe
ADMIN_EMAIL Administrative user's e-mail address. john@example.com
ADMIN_PASSWORD Administrative user's password. admin12
ADMIN_URL Enter the relative URL by which to access the Magento Admin. For security reasons, we recommend you choose a value other than admin or backend or another term that is easy to guess. admin
ADMIN_LOCALE Specifies the default locale used by the Magento Admin. en_US
APPLICATION_MODE

Determines whether or not Magento operates in developer mode or in production mode. During deployment, we recommend the default mode.

The variable supports the following values: production and developer. You cannot set this value to default mode. After you have changed the mode with an environment variable, it can only be set to production or developer.

To execute build and deploy scripts in a specific mode, set an environment variable for APPLICATION_MODE. If you execute these scripts in default mode without APPLICATION_MODE set as an environment variable, the mode will be set to production.

production
CLEAN_STATIC_FILES

The default value, true, cleans generated static view files when you perform an action like enabling or disabling a component. We recommend the default value in development.

Failure to clear static view files might result in issues if there are multiple files with the same name and you don't clear all of them.

In other words, because of static file fallback rules, if you do not clear static files and there is more than one file named logo.gif that are different, fallback might cause the wrong file to display.

true
UPDATE_URLS

On deployment, replace Magento base URLs in the database with project URLs. This is useful for local development, where base URLs are set up for your local environment. When you deploy to a Cloud environment, we change the URLs so you can access your storefront and Magento Admin using project URLs.

You should set this variable to disabled only in staging or production, where the base URLs can't change.

enabled

For an example, see Step 1, Get started setting up an environment.

Troubleshooting

In the event something goes wrong and you can’t access your environment after it deploys, try the following:

  • SSH to the environment and make sure services are running.
  • Restore your snapshot:

    magento-cloud snapshot:list
    magento-cloud snapshot:restore <snapshot>