# Windows requirements

## Using WSL

### 1. Install WSL

To install WSL2 on Windows follow [this guide](https://docs.microsoft.com/en-us/windows/wsl/install-win10).

{% hint style="info" %}
For [step #6 Install your Linux distribution of choice](https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-6---install-your-linux-distribution-of-choice) we recommend choosing the latest Ubuntu release, as it has the best compatibility on Windows.
{% endhint %}

### 1.1 Install Windows Terminal (Optional)

On Windows with WSL, it is recommended to use [Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/get-started).\
By using it you can open different shells and access different WSL distros in the same place, which is quite handy.

### 1.2 Install Visual Studio Code (Optional)

VSCode has excellent integration with WSL, so you can run commands, edit code and debug it inside a single editor.\
[Developing in WSL](https://code.visualstudio.com/docs/remote/wsl).

![](https://1705439005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOVnS5lKxiIvOL9no4d%2F-McUL2bDOck2EgQmaF-T%2F-McUVj3wq2v7f-su7w7s%2FScreenshot%20\(2\).png?alt=media\&token=a4a3a047-26c5-4e01-9506-b6b92dbdef49)

### 2. Install Docker Desktop for Windows

Download and install [Docker Desktop for Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows).

### 3. Enable WSL 2 integration in Docker Desktop settings

Go to **Docker Desktop settings > General** and make sure that **Use the WSL 2 based engine** checkbox is checked.

![](https://1705439005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOVnS5lKxiIvOL9no4d%2F-McUL2bDOck2EgQmaF-T%2F-McUOZ_owueFFwA0YvX7%2FScreenshot%202021-06-18%20165003.png?alt=media\&token=1a5a596d-b42b-49e0-8d41-f1857a763fdd)

Then, go to Resources >WSL Integration and enable WSL integration into your distro.

![](https://1705439005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOVnS5lKxiIvOL9no4d%2F-McUL2bDOck2EgQmaF-T%2F-McUOmfYntDg4h1lLMRN%2FScreenshot%202021-06-18%20165050.png?alt=media\&token=893e5943-ab5a-4d9b-b4b9-41046f633a3c)

Toggle your distro and click **Apply & Restart**.

### 4. 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>"
           }
       }
   }
   ```

### 5. 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 %}

## Using VM

As an option, you can run CMA on Windows using a Linux VM running in [Virtual Box](https://www.virtualbox.org/) (free) or [VMWare Workstation Player](https://www.vmware.com/products/workstation-player.html) (paid).\
We recommend using [Ubuntu](https://ubuntu.com/download/desktop) or [Fedora](https://getfedora.org/en/workstation/download/) distros, although [Linux Mint](https://linuxmint.com/download.php), [CentOS](https://www.centos.org/download/) and distros based on `apt` , `pacman`, `yum`, `dnf` package managers should also work.\
[Installation guide](https://docs.create-magento-app.com/getting-started/prerequisites/installation-on-linux) for this option is the same as installing on a regular Linux platform.
