# MacOS requirements

{% hint style="success" %}

### **Apple Silicon** is supported as well!

All images come with arm64 architecture support!
{% endhint %}

## 1. Install Docker for Mac

Download and install Docker Desktop for Mac following the [official installation guide](https://docs.docker.com/docker-for-mac/install/).

{% hint style="warning" %}

## Heads up!

If you are working outside of the user's directory make sure to add your directory to the 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 a **startup** **error**.
{% endhint %}

### 1.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.

{% hint style="success" %}

### Don't forget to enable VirtioFS in your Docker Desktop settings!

You can learn more about this experimental feature [here](https://docs.create-magento-app.com/usage-guide/improve-performance#enabling-virtiofs-in-docker-desktop-on-mac).
{% endhint %}

## 2. Prepare the environment

If you don't have **COMPOSER\_AUTH** environment variable or **auth.json** file in your project, CMA will run a setup wizard with detailed instructions for you to get access keys for the Magento repository.\
But you can also set up them manually by following the instructions below.

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

1. Go to <https://marketplace.magento.com/customer/accessKeys/>
2. 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.

   ```bash
   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>"
           }
       }
   }
   ```

## 3. Start your application

{% hint style="info" %}
Start command description can be found [here](https://docs.create-magento-app.com/getting-started/available-commands/start).\
To access Magento CLI, Composer and PHP use [cli](https://docs.create-magento-app.com/getting-started/available-commands/cli) command.
{% endhint %}
