Configure the build machine

The following sections discuss how to configure the build machine.

Install Composer

First, check if Composer is already installed:

In a command prompt, enter any of the following commands:

  • composer --help
  • composer list --help

If command help displays, Composer is already installed.

If an error displays, use the following steps to install Composer.

To install Composer:

  1. Change to or create an empty directory on your Commerce server.

  2. Enter the following commands:

    curl -sS https://getcomposer.org/installer | php
    
    mv composer.phar /usr/local/bin/composer
    

For additional installation options, see the Composer installation documentation.

Install PHP

Install PHP on CentOS or Ubuntu.

Set up the build system

To set up the build system:

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

  2. Retrieve the Commerce code from source control.

    If you use Git, use the following command:

    git clone [-b <branch name>] <repository URL>
    
  3. Change to the Commerce root directory and enter:

    composer install
    
  4. Wait for dependencies to update.

  5. Set ownership:

    chown -R <Commerce file system owner name>:<web server username> .
    

    For example,

    chown -R commerce-username:apache .
    
  6. If you use Git, open .gitignore in a text editor.

  7. Start each of the following lines with a # character to comment them out:

    # app/etc/config.php
    # pub/media/*
    # generated/*
    # pub/media/*.*
    # pub/media/wysiwyg/*
    # pub/static/*
    
  8. Save your changes to .gitignore and exit the text editor.

  9. If you use Git, use the following commands to commit the change:

    git add .gitignore && git commit -m "Modify .gitignore for build and production"
    

    See the .gitignore reference for more information.

  10. The build system should use default mode or developer mode:

    bin/magento deploy:mode:set <mode>
    

    <mode> is required. It can be either default or developer.

Previous pageDevelopment system setup
Next pageProduction system setup

Commerce