Create Magento App
Create ScandiPWA AppScandiPWA DocsGitHub
v1
v1
  • Create Magento App
  • Getting started
    • Getting Started
    • Prerequisites
      • Linux requirements
      • MacOS requirements
        • Apple Silicon
      • Windows requirements
    • Available commands
      • Start the application
      • Stop the application
      • Check application status
      • Enter application CLI
      • Explore application logs
      • Execute commands in Docker containers
      • Link a theme
      • Import database dump
      • ⚠️ Uninstall a project
    • Folder structure
    • Updating to New Releases
      • Testing Alpha Releases
    • Configuration File
    • Supported Magento versions
    • How does it work?
    • Limitations
  • Usage guide
    • Using console commands
    • Accessing Docker containers
    • Linking a Scandi Theme
    • Enabling XDebug
    • Enabling SSL
    • Configuring PHP
    • Use custom domain
    • Access on the local network
    • Importing database
      • Importing remote database
    • Using Enterprise Edition
    • Converting legacy Docker setup to CMA
    • Improve Performance
  • Scripts Extensions
    • PHP Extensions
      • ionCube Extension
  • Troubleshooting
    • Common Issues
    • CMA Debugging
    • Uninstall CMA
Powered by GitBook
On this page
  • yarn start or npm run start
  • Command options
  • Usage example
  1. Getting started
  2. Available commands

Start the application

yarn start or npm run start

This command executes a local deployment of your Magento 2 application. It does it in the following steps:

  1. Prepare your project for Magento 2.

  2. Install and compile the correct PHP version with required extensions to run Magento 2.

  3. Deploy services, Redis, MySQL, ElasticSearch and Nginx, in Docker containers for Magento 2.

  4. Install Magento 2 with Composer.

  5. Setup Magento 2.

  6. Open a browser with up and running Magento 2 store.

Command options

-p, --port

A port to run your application on.

By default, Create Magento App will select a random available port.

yarn start --port <port> # for Yarn
npm run start -- --port <port> # for NPM

-n, --no-open

Disable auto-open of a browser window at the end of the workflow.

yarn start --no-open # for Yarn
npm run start -- --no-open # for NPM

-d, --debug

yarn start --debug # for Yarn
npm run start -- --debug # for NPM

-s, --skip-setup

Skips Magento setup.

Skipping Magento setup might result in conflict during runtime because Magento config will not be updated with a new port config. This option can be used only if you 100% sure that the ports configuration is the same.

In a nutshell, this option enables start command will just restart services and PHP-FPM, so if you need to restart the project it can be done in under 10 seconds*.

yarn start --skip-setup # for Yarn
npm run start -- --skip-setup # for NPM

* Tested on Ryzen 9 3900x system with NVME SSD with a result in 9.5s.

--import-db

Since magento-scripts@1.3.0

Imports database dump to the MySQL container.

yarn start --import-db ./dump.sql # for Yarn
npm run start -- --import-db ./dump.sql # for NPM

--recompile-php

Since magento-scripts@1.6.0

Sometimes, on macOS when dynamic dependencies are updated, PHP might break. To fix this issue you need to manually delete the PHP binary in ~/.phpbrew/php/php-<version>, so CMA will detect it and compile it. Now, you just need to pass this option in the start command and CMA will take care of everything.

yarn start --recompile-php # for Yarn
npm run start -- --recompile-php # for NPM

-v, --verbose

Since magento-scripts@1.8.0

This option will enable printing of logs from Magento installation, setup and upgrade tasks.

yarn start --verbose # for Yarn
npm run start -- --verbose # for NPM

Usage example

yarn start # for Yarn
npm start # for NPM
PreviousAvailable commandsNextStop the application

Last updated 2 years ago

Enable for debugging PHP.

Does the same thing as the command but allows to use it during start, so the project can be bootstrapped from zero in 1 command.

XDebug
import-db