Environment setup commands
Creates a new environment.
Clones an existing project.
Provides a list of all of your environments, together with their status, directory location, and base URL.
Environment management commands
The following commands should be run from inside a project directory, e.g.
Starts an environment. Please remember that each environment consumes memory and system resources whilst it is started. Ideally, you should only keep one environment started at any one time.
Stops an environment.
Cycles through the stop and start events.
This removes an environment from the underlying Docker layer. However, it does not remove any of your project files. By default a backup of the database is done as part of this process. If you do not want a database snapshot, use the command
dx delete --omit-snapshot instead.
Unless you delete the project's files, you can re-use a project that has been deleted by simply running
dx start from within the project's directory.
Executing this command within a project directory outputs the URLs for the various services and companion applications that are available.
This command enables you to call
bin/magento. For example, running
dx magento cache:flush is equivalent to
bin/magento cache:flush. The command is only available for Magento 2 environments.
This command allows you to execute anything arbitrarily inside your environment. For example,
dx exec ls -alh.
This command gives you access to Composer within your environment.
The n98-magerun2 tool is installed within each Magento 2 environment. You can access it using the following command,
dx exec magerun2.
This command gives you access to the MySQL client within your environment.
This command gives you access to the PHP CLI within your environment.
packages.json file for the first time, running
Once that has been done you can, for example with a Magento 2 project, use commands like:
dx yarn grunt clean dx yarn grunt exec dx yarn grunt less dx yarn grunt watch
You can enable Xdebug within an environment with
dx xdebug on, and disable it with
dx xdebug off. We currently support Visual Studio Code and PHPStorm.
This creates an isolated SSH session for your environment. You can now run commands directly in that environment. This allows you, for example, to run commands like
bin/magento cache:flush rather than needing to do
dx magento cache:flush.
Configuration management tasks
Changing your PHP version
If you need to change the PHP version within an environment, use:
dx config --php-version=8.2 dx restart