Configure your project
For all Adobe Commerce on cloud infrastructure projects, you can use the Project Web Interface to perform the following tasks:
Changes that you make to environment configuration trigger a redeployment of that environment.
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:
- Log in to your project.
- The left pane shows your list of environments.
- Click Access Site for a list of storefront URLs for web access and the command for SSH access.
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.
Click either CLI or Git to display the appropriate clone command. Use the (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. |
DO NOT use the HTTP access control method for securing Pro Staging and Production environments. This will break Fastly caching. You must use the Blocking feature available in the Fastly CDN for Magento.
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 theenable_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:
-
Access your project and select the environment to configure.
-
Select Configure environment, and then select the Variables tab.
-
To enable or disable outgoing emails, toggle Outgoing emails On or Off.
After you change the setting, the environment builds and deploys with the new configuration.
To manage email support from the command line:
-
Check the current email configuration in the Project Web Interface.
-
If needed, change the email configuration.
-
From the command line, change to the directory where you cloned your Cloud project.
-
Log in to the project.
1
magento-cloud login
-
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>
-
Change the email support configuration by setting the
enable_smtp
environment variable totrue
orfalse
.1
magento-cloud environment:info --refresh -p <project-id> -e <environment-id> enable_smtp true
Wait for the environment to build and deploy.
-
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:
- Access your project.
-
Select the Settings icon, and then select the Variables tab.
- Click Add Variable.
- In the Name field, enter a variable name. For example, to set the Admin email for the default account, enter
ADMIN_EMAIL
. -
In the Value field, enter the value for the variable. For example, enter a valid email address accessible for reset email notifications.
- 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.
- 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:
- Access your project and select a specific environment.
- Select Configure environment.
- Select the Variables tab.
- Click Add Variable.
- In the Name field, enter a variable name. For example, to set the Admin default account password, enter
ADMIN_PASSWORD
. -
In the Value field, enter the value for the variable. For example, enter a valid email address accessible for reset email notifications.
- 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.
- 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:
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.
- Access your project and select a specific environment.
- Select Configure environment.
- Select the Routes tab.
- Select Add Route.
- Enter a URL. You can use
{default}
in the URL, which is a placeholder for the default domain. - Select a Type: Upstream for applications or Redirect.
-
To configure an Upstream route:
- Enter the Upstream route.
- Use the toggle to enable or disable the Cache for the route.
- Enter the cookies to list: No cookies, All cookies, or Specify a specific cookie. You can enter multiple specific cookies.
- To add Headers to an allowlist, select Default Headers or Specify a header. You can enter multiple headers.
- Use the toggle to enable or disable the Server-Side Includes (SSI).
- 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. -
Click Add Route to save. The setting is saved and deployed to the environment.
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.
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