MacOS requirements
Apple Silicon is supported as well! To get CMA working on Apple Silicon go to the following section.

1. Install Brew

Brew can be installed from the official website or you can copy-paste this command in your mac terminal:
1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copied!

2. Install dependencies

Run the command below to install the required system dependencies.
Since [email protected] CMA will also check installed dependencies before starting the application. If some of them are missing, will provide instructions on how to install them!
1
brew install zlib \
2
bzip2 \
3
libiconv \
4
curl \
5
libpng \
6
gd \
7
freetype \
8
oniguruma \
9
icu4c \
10
libzip \
11
libxml2 \
12
libsodium
Copied!

3. Install Docker for Mac

Download and install Docker Desktop for Mac following the official installation guide.

Heads up!

If you are working outside of users directory make sure to add your directory to bindable directory list in Docker preferences. (Docker -> Preferences -> Resources -> File Sharing) If you don't do that, Docker will be unable to mount some directories inside containers and you will get startup error.

3.1 Increase available resources for Docker

Increase the amount of allocated memory to at least 4 GB. Go to Docker > Preferences > Resources > Memory > Advanced. There drag memory slider to be at least 4 GB. You can also decrease swap size to its minimum value. Also, you can increase the number of CPUs available for Docker. By default, Docker Desktop is set to use half the number of processors available on the host machine. The more you set, the faster Docker containers will be. Just note that the more CPUs you select, the fewer resources will be left for your system.

4. Install PHPBrew

Since [email protected] this part will be done automatically.
PHPBrew is used to compile PHP with required extensions to run Magento 2 on your system.
1
# Install XCode
2
xcode-select --install
3
4
# Install PHPBrew dependencies
5
brew install autoconf pkg-config
6
7
# Download PHPBrew
8
curl -L -O https://github.com/phpbrew/phpbrew/releases/latest/download/phpbrew.phar
9
10
# Make it executable
11
chmod +x phpbrew.phar
12
13
# Move PHPBrew binary to system folder.
14
sudo mv phpbrew.phar /usr/local/bin/phpbrew
15
16
# Initialize PHPBrew
17
phpbrew init
Copied!

5. Prepare the environment

5.1 Use auth.json

Some projects have different authentication keys for repositories, so you can use auth.json file in the root of your project and put credentials inside this file. CMA will handle everything from here.
Learn more about composer authentication per project here.

5.2 Use COMPOSER_AUTH environmental variable

COMPOSER_AUTH is an environment variable that is used to authenticate your Magento project on Magento Composer Repository which contains Magento dependencies. TO obtain it:
    1.
    NOTE: you have to be authorized.
    2.
    Generate Access Key pair.
    3.
    Replace <public key> and <private key> with your public and private key.
    1
    export COMPOSER_AUTH='{
    2
    "http-basic":{
    3
    "repo.magento.com": {
    4
    "username": "<public key>",
    5
    "password": "<private key>"
    6
    }
    7
    }
    8
    }'
    Copied!
    4.
    Add result from steps above to your .zshrc.
    5.
    Reload terminal.

6. Start your application

Start command description can be found here.
Last modified 2mo ago