Linux requirements

OpenSSL 3.0 is not supported! PHP introduced support for OpenSSL 3.0 only in PHP 8.1, so you will not be able to compile older versions of PHP if you have OpenSSL 3.0 in your system. Ubuntu 22.04 ships with OpenSSL 3.0, so ATM you will need an older release of Ubuntu of another distro that has OpenSSL 1.1

1. Install platform-specific dependencies:

Since magento-scripts 1.4.0 CMA will also check installed dependencies before starting the application, and if they are missing will provide instructions on how to install them!

sudo apt install \
    libcurl4-openssl-dev \
    libonig-dev \
    libjpeg-dev \
    libjpeg8-dev \
    libjpeg-turbo8-dev \
    libpng-dev \
    libicu-dev \
    libfreetype6-dev \
    libzip-dev \
    libssl-dev \
    build-essential \
    libbz2-dev \
    libreadline-dev \
    libsqlite3-dev \
    libssl-dev \
    libxml2-dev \
    libxslt1-dev \
    libonig-dev \
    php-cli \
    php-bz2 \
    pkg-config \
    autoconf \
    libsodium-dev \
    cmake \
    php

2. Install Docker

You can follow the official installation guide from Docker or use commands below:

# Download installation script
curl -fsSL https://get.docker.com -o get-docker.sh

# Run installation script
sudo bash get-docker.sh

# Add your user to the “docker” group to run docker without root.
sudo usermod -aG docker $USER

# After that you'll need to logout and login to your account or,
# you can temporarily enable group changes by running command below
newgrp docker

3. Install PHPBrew

Since magento-scripts@1.7.0 this part will be done automatically.

To install PHPBrew on Linux you will need to follow installation instructions or use commands below:

# Download PHPBrew
curl -L -O https://github.com/phpbrew/phpbrew/releases/latest/download/phpbrew.phar

# Make it executable
chmod +x phpbrew.phar

# Move PHPBrew binary to system folder.
sudo mv phpbrew.phar /usr/local/bin/phpbrew

# Initialize PHPBrew
phpbrew init

4. Prepare the environment

To work with Magento you need access keys to access the Magento repository.

  1. Generate Access Keypair

Now you have a public key and private key values.

To use them you have 2 options:

  1. Use COMPOSER_AUTH environmental variable

    This option is used as a global variable on your machine.

    Replace <public key> and <private key> with your public and private key.

    export COMPOSER_AUTH='{
        "http-basic":{
            "repo.magento.com": {
                "username": "<public key>",
                "password": "<private key>"
            }
        }
    }'

    Add the result to your .bashrc or .zshrc and reload your terminal.

  2. Use auth.json file

    This option is used on a per-project basis, so your credentials will be always correct no matter which project you are working on.

    Create auth.json file in the root of your project and inside put the following content using the same <public key> and <private key> you obtained before:

    {
        "http-basic":{
            "repo.magento.com": {
                "username": "<public key>",
                "password": "<private key>"
            }
        }
    }

5. Start your application

Start command description can be found here. To access Magento CLI, Composer and PHP use cli command.

Last updated