Set up Environment for OroPlatform Based Application on Windows Subsystem for Linux (WSL) 2

This guide demonstrates how to set up Docker and Symfony Server development stack for Oro applications on Windows 10, version 1903 or higher.

Environment Setup

  1. Install Ubuntu 20.04 LTS from the Microsoft Store that will be used with WSL 2.

  2. Install Windows Terminal. It’s not required to use a Windows Terminal but we recommend using it as it comes with the built-in WSL integration.

  3. Install Docker Desktop for Windows.

  4. Enable Docker Desktop WSL 2 backend for the Ubuntu 20.04 LTS distribution that you installed at step 1.

  5. Log into Ubuntu 20.04 LTS using Windows Terminal. All the below commands will be executed in it.

  6. Install PHP 8.0 with all required extensions to Ubuntu 20.04 LTS:

    sudo apt install software-properties-common
    sudo add-apt-repository -y ppa:ondrej/php
    sudo apt update
    sudo apt -y install php8.0 php8.0-fpm php8.0-cli php8.0-pdo php8.0-mysqlnd php8.0-xml php8.0-soap php8.0-gd php8.0-zip php8.0-intl php8.0-mbstring php8.0-opcache php8.0-curl php8.0-bcmath php8.0-ldap php8.0-pgsql php8.0-dev php8.0-mongodb
    
  7. Configure PHP:

    echo -e "memory_limit = 2048M \nmax_input_time = 600 \nmax_execution_time = 600 \nrealpath_cache_size=4096K \nrealpath_cache_ttl=600 \nopcache.enable=1 \nopcache.enable_cli=0 \nopcache.memory_consumption=512 \nopcache.interned_strings_buffer=32 \nopcache.max_accelerated_files=32531 \nopcache.save_comments=1" | sudo tee -a  /etc/php/8.0/fpm/php.ini
    echo -e "memory_limit = 2048M" | sudo tee -a  /etc/php/8.0/cli/php.ini
    
  8. Install Node.js 12:

    sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    sudo apt -y install nodejs
    
  9. Install Composer:

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php
    php -r "unlink('composer-setup.php');"
    sudo mv composer.phar /usr/bin/composer
    
  10. Install Symfony Server:

sudo apt -y install libnss3-tools
wget https://get.symfony.com/cli/installer -O - | bash
echo 'PATH="$HOME/.symfony/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
symfony server:ca:install

Note

You can also enable TLS, but as Symfony Server does not automate certificate installation for WSL on Windows, you will have to copy the generated certificate manually from the /usr/local/share/ca-certificates/ folder to the host filesystem and install it manually to your web browser.

  1. Restart the terminal and web browser to get them ready.

What’s Next