Install

Previous step

Clone and branch the project

With your workspace prepared, install Adobe Commerce on your local workstation to verify custom code, extensions, and more. This section includes the installation prep, options, and post-installation configuration you should complete.

Prepare to install Adobe Commerce

To customize the Adobe Commerce software on your local workstation, prepare the following:

  • Hostname or IP address of your machine
  • Admin username, password, and URL created earlier
  • Authentication keys for downloading the Adobe Commerce Composer metapackage

List the Admin environment variables

You need the ADMIN environment variables for the installation command line.

List the environment variables.

1
magento-cloud variable:get -e <environment-ID>
1
2
3
4
5
6
7
+----------------+---------------+-----------+------+
| ID             | Value         | Inherited | JSON |
+----------------+---------------+-----------+------+
| ADMIN_PASSWORD | admin_A456    | Yes       | No   |
| ADMIN_URL      | magento_A8v10 | Yes       | No   |
| ADMIN_USERNAME | admin_A456    | Yes       | No   |
+----------------+---------------+-----------+------+

Get authentication keys

You need authentication keys to install Adobe Commerce in your local development environment. These are different than the authentication keys included in the code repository auth.json file. See Add authentication keys.

To create authentication keys:

  1. Log in to the Commerce Marketplace. If you do not have an account, click Register.

  2. Click your account name in the top-right and select My Profile.

  3. Click Access Keys under My Products in the Marketplace tab.

    Click Access Keys

  4. Click Create A New Access Key.

  5. Enter a specific name for the keys, for example CloudProductOwner or the name of the developer receiving the keys.

  6. The keys generate a Public and Private key you can click to copy. Save this information or keep the page open when installing Adobe Commerce.

Set the docroot

Set the docroot to the /magento directory until you complete the setup.

For the Production environment, set the docroot to /magento/pub, which helps restrict access to vulnerable areas of the system. The webserver docroot should be set to /magento/pub only after Adobe Commerce is installed (including any upgrades and patches), configured, and static files generated and populated in /magento/pub. Alternatively, you could create a subdomain (for example, install.domain.com) and configure your webserver docroot to the Adobe Commerce installed root folder.

Set file system permissions and ownership

After you have installed Adobe Commerce, you need to set the file system permissions and ownership.

  1. Log in to your server as, or switch to, the file system owner.

  2. Enter the following commands in the order shown:

    1
    
    cd <magento_root>
    
    1
    2
    
    find var vendor pub/static pub/media app/etc -type f   -exec chmod g+w {} +
    find var vendor pub/static pub/media app/etc -type d   -exec chmod g+ws {} +
    
    1
    
    chown -R :<web server group> .
    
    1
    
    chmod u+x bin/magento
    

To optionally enter all commands on one line, enter the following assuming Magento is installed in /var/www/html/magento2 and the web server group name is apache:

1
cd /var/www/html/magento2 && find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && chown -R :apache . && chmod u+x bin/magento

In the event file system permissions are set improperly and can’t be changed by the file system owner, you can enter the command as a user with root privileges:

1
cd /var/www/html/magento2 && sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && sudo chown -R :apache . && sudo chmod u+x bin/magento

Install Adobe Commerce

Prior to installing, you should Update installation dependencies using Composer commands.

Be ready to install Adobe Commerce using the command line.

To install Adobe Commerce using the command line:

  1. Switch to the user.

    1
    
    sudo su - magento
    
  2. Change directories for the installation.

    1
    
    cd /app/bin
    
  3. Enter a CLI command with options for entering the name, email, ADMIN credentials, URL, and additional information. For a list of all options, see Installer help commands.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    bin/magento setup:install \
      --admin-firstname=John \
      --admin-lastname=Smith \
      --admin-email=jsmith@mail.com \
      --admin-user=admin \
      --admin-password=password1 \
      --base-url=http://magento.local/ \
      --db-host=localhost \
      --db-name=magento \
      --db-user=magento \
      --db-password=magento \
      --currency=USD \
      --timezone=America/Chicago \
      --language=en_US \
      --use-rewrites=1
    

Post-install configurations

After installing Adobe Commerce, run the commands for compile and deploy for the code:

  1. Switch to the correct user.

    1
    
    sudo su - magento
    
  2. Change to the app/bin directory.

  3. Compile Adobe Commerce.

    1
    
    bin/magento setup:di:compile
    
  4. Deploy Adobe Commerce

    1
    
    bin/magento setup:static:deploy
    

Optionally, if you used Vagrant with the hostmanager plugin, update the hosts file.

  1. Access the localdev root for the Vagrant box.

  2. Update the hosts file.

    1
    
    vagrant hostmanager
    

Additional software and services

For development and testing in an environment as close to Integration as possible, you may also want to install additional tools, software, and services. These services are configured using services.yaml.

Verify your local workspace

To verify the local, access the store using the URL you passed in the install command. For this example, you can access the local Adobe Commerce store using the following URL formats:

  • http://magento.local/
  • http://magento.local/admin

To change the URI for the Admin panel, use this command to locate it:

1
bin/magento info:adminuri

To verify the Integration master branch environment, log into the Project Web Interface and select your named project. In the list of branches, select the Master. Click Access site to pull up a list of URLs (HTTP and HTTPS) and click the preferred link to open the site. To view the admin, add /admin or other configured Admin URI.

Click Access for list of URLs

With these steps completed, you should have:

  • A Adobe Commerce account and initial project setup and master branch
  • A local workspace configured with installations of required software, Magento Cloud CLI
  • SSH keys set up
  • The file system owner configured
  • Your initial code branch
  • Authentication keys set up and configured in the project and your local workstation

Next step

For Pro projects, we strongly recommend fully deploying this base template master branch without any code or configuration changes to Staging and Production. For instructions, see First time deployment.

For Starter projects, you are ready to start developing.