Configure your project

The Adobe Commerce on cloud infrastructure Project Web Interface enables you to do the following for all Starter and Pro environments:

As you make changes to these settings, the branch redeploys to the environment. You can make these setting changes for all Starter and Pro environments.

Access your project and environments

The Project Web Interface provides several ways to access your project and environments:

  • Storefront URL for each active environment
  • Secure Shell (SSH) link for SSH access via terminal application
  • Clone the project using the Magento Cloud CLI or Git

To access projects and environments through the Project Web Interface:

  1. Log in to your project.
  2. Click Access Site for a list of URLs for web access and the command for SSH access.

    Access your project by URL or SSH

For more information about using SSH, see SSH to an environment. To clone the project using either the Adobe Commerce on cloud infrastructure CLI or Git, use the links in the field under the branch name.

The following figure shows an example.

Clone the project

Click either CLI or Git to display the appropriate clone command. Use the Copy to clipboard (Copy to clipboard) button to copy the command to the clipboard.

Configure environment settings

You can set the following configuration options for each environment:

Option Description
Environment status An environment can be either active or inactive. You'll do most of your work in an active environment. After merging an environment with its parent, you can optionally delete the environment, making it inactive. To delete an environment, click Delete. You can active an inactive environment later.
Outgoing emails Setting this option On enables support for sending emails from the environment using the SMTP protocol.
HTTP access control Setting this option On enables you to configure security for the Project Web Interface using a login and also IP address access control.

Configure emails for testing

By default, email support is disabled on Staging and Production environments. You must enable email support on an environment to send emails including Welcome, password reset, and two-factor authentication emails for Cloud project users.

You can manage email support for each Cloud project environment from the Project Web Interface or from the command line.

  • On master and integration branches, use the Outgoing emails toggle in the Project Web interface to enable or disable email support.

  • On Production and Staging environments or other environments where the Outgoing emails toggle is not available in the Project Web Interface, you can check the current configuration from the Project Web Interface, but you can only change the configuration from the command line using the Cloud CLI for Commerce environment:info command to set the enable_smtp property.

    Enabling SMTP updates the MAGENTO_CLOUD_SMTP_HOST environment variable with the IP address of the SMTP host for sending mail.

Updating the environment configuration triggers a redeployment, which takes your site offline until deployment completes. For Production environments, Adobe recommends completing this work during off-peak hours to avoid service disruptions. See Working with variables.

To manage email support from the Project Web Interface:

  1. Access your project and select the environment to configure.

  2. Select Configure environment, and then select the Variables tab.

  3. To enable or disable outgoing emails, toggle Outgoing emails On or Off.

    Set outgoing emails

After you change the setting, the environment builds and deploys with the new configuration.

To manage email support from the command line:

  1. Check the current email configuration in the Project Web Interface.

    Check outgoing email configuration

  2. If needed, change the email configuration.

  3. From the command line, change to the directory where you cloned your Cloud project.

  4. Log in to the project.

    1
    
    magento-cloud login
    
  5. If you do not have the project ID and environment ID for the environment, use the following commands to get the values.

    1
    
    magento-cloud project:list
    
    1
    
    magento-cloud environments -p <project-id>
    
  6. Change the email support configuration by setting the enable_smtp environment variable to true or false.

    1
    
    magento-cloud environment:info --refresh -p <project-id> -e <environment-id> enable_smtp true
    

    Wait for the environment to build and deploy.

  7. Verify that email is working:

    • Use SSH to connect to your environment.

    • Check that the MAGENTO_CLOUD_SMTP_HOST value is set.

      1
      
      printenv MAGENTO_CLOUD_SMTP_HOST
      
    • Send a test email to your email address or another address you can check.

      1
      
      php -r 'mail("mail@example.com", "test message", "just testing", "From: tester@example.com");'
      

Set project and environment variables

You can set project wide and environment specific variables through the Project Web Interface. Variables can be either text or JSON format. Project variables are set across all branches and environments. Use environment variables for sensitive data like payment method information. For more information, see Environment variables.

To view or edit environment variables, you must have at minimum the project reader role with environment admin privileges.

If you want to add the same variables to your Integration, Staging, and Production environments, we recommend adding all of the variables one at a time to the Integration environment. After you finish adding variables, push the changes to the Staging and Production environments.

Project variables

To set project variables in the Project Web Interface:

  1. Access your project.
  2. Select the Settings icon, and then select the Variables tab.

    Configure project variables

  3. Click Add Variable.
  4. In the Name field, enter a variable name. For example, to set the Admin email for the default account, enter ADMIN_EMAIL.
  5. In the Value field, enter the value for the variable. For example, enter a valid email address accessible for reset email notifications.

    Set project variables

  6. As needed, select options for JSON value, Visible during build, and Visible during runtime. If you do not have Super User access, you may only see the JSON value option.
  7. Click Add Variable. After you add the variable, the environment will deploy. Wait until deployment completes before more edits.

Environment variables

To set environment specific variables in the Project Web Interface:

  1. Access your project and select a specific environment.
  2. Select Configure environment.
  3. Select the Variables tab.
  4. Click Add Variable.
  5. In the Name field, enter a variable name. For example, to set the Admin default account password, enter ADMIN_PASSWORD.
  6. In the Value field, enter the value for the variable. For example, enter a valid email address accessible for reset email notifications.

    Set environment variables

  7. As needed, select options for JSON value, Enabled, Inheritable by child environments and Sensitive. If you do not have Super User access, you may only see the JSON value option.
  8. Click Add Variable. After you add the variable, the environment will deploy. Wait until deployment completes before more edits.

If you are attempting to override configuration settings, you must prepend env: to the variable name. For example: Environment variable example

Configure routes

Routes allow you to set redirects or upstream settings for applications for your specific environment. For full details on routes, see routes.yaml. These routes (or URLs) are used to access your storefront.

  1. Access your project and select a specific environment.
  2. Select Configure environment.
  3. Select the Routes tab.
  4. Select Add Route.
  5. Enter a URL. You can use {default} in the URL, which is a placeholder for the default domain.
  6. Select a Type: Upstream for applications or Redirect.
  7. To configure an Upstream route:

    1. Enter the Upstream route.
    2. Use the toggle to enable or disable the Cache for the route.
    3. Enter the cookies to list: No cookies, All cookies, or Specify a specific cookie. You can enter multiple specific cookies.
    4. To add Headers to an allowlist, select Default Headers or Specify a header. You can enter multiple headers.
    5. Use the toggle to enable or disable the Server-Side Includes (SSI).
  8. To configure a Redirect, enter a URL to Redirect to. You can use {default} in the URL, which is a placeholder for the default domain.
  9. Click Add Route to save. The setting is saved and deployed to the environment.

    Configure a route

View environment history

An environment’s history includes:

  • Initial creation
  • Snapshots
  • Syncs and merges
  • Code pushes

To view the history for an environment, log in to your project and select the environment. The page displays a general history of actions completed on the page. For a detailed list of completed actions during build and deployment, Adobe recommends reviewing logs directly on the servers. See View logs.

The following figure shows a sample history.

Sample environment history

The history shows, from oldest to newest:

  • Environment branched from FeatureX
  • Environment synced with the parent
  • Environment snapshot created

Adobe recommends creating a snapshot before you make any code changes.

  • Environment variable added
  • Environment snapshot created