Skip to content

Project configuration via .valet-sh.yml

Create a stub file

To create a stub file execute the following command

valet.sh init

This creates the file .valet-sh.yml in the current folder, thus make sure to have your project root as current working directory when executing this command.

After having created the stub file, make sure to configure the settings as required for your project.

The documentation for the command above can be found here.

Configuration settings

WIP: this list may not be completely finished.

Configuration Path Example Default Description
hub
hub > host xyz.yourserver.com dummy.example.com SFTP Server to fetch instance backup files from
hub > port 22 22 SFTP Port
hub > path /data /data Absolute path in which instance backup files are provided
hub > user root SFTP User
services
services > composer
services > composer > version 2 1 Composer version to be used inside the project (1 or 2).
services > node
services > node > version 11 14 Node.js version that shall be used to set up the project
services > php
services > php > version 7.4 The PHP version for the project. This value will ensure:The given version is used for web access to your project (e. g. project.test)The given version is used on the CLI within the project folder
services > mysql
services > mysql > version 8.0 The MySQL version for the project. The given version will be started and the dump will be imported into this instance.
services > mysql > database projectx Database name to import the dump. If the database already exists, it will be dropped before.
services > mariadb
services > mariadb > version 10.4 The MariaDB version for the project. The given version will be started and the dump will be imported into this instance.
services > mariadb > database projectx Database name to import the dump. If the database already exists, it will be dropped before.
services > elasticsearch
services > elasticsearch > version 6 7 The Elasticsearch version for the project.
services > elasticsearch > plugins analysis-phonetic and `analysis-icu Subset of plugins to enable, specified in YAML block sequence notation.
services > rabbitmq
services > rabbitmq > vhost project-x Name of the RabbitMQ virtual host that will be used in the project. If the vhost does not exist, it is created
instance
instance > key projectX The 2nd level domain used to access the project locally.Example:Given that the value "myproject" is configured, the project will be accessible via the domain "myproject.test"
instance > type magento2 Defines the project type, which will be used when linking the project.Valid values are:"magento1""magento2""neos"""
instance > path src Defines the path, relative to the project root, to the document root of the project.
instance > multidomain de: "default"
en: "en"
Defines the mapping of domain prefixes (aka 3rd level domains) to store codes, specified as YAML Mapping of Scalars.Example:Given thatthe project is accessible locally using the domain "myproject.test"there is a store view with the store code "foo_bar"the store view shall be accessible through the domain "myfoo.myproject.test"Then the following mapping entry should be addedmyfoo: foo_bar
instance > sync
instance > sync > identifier prod test Defines the unique name of the remote instance from which data (database & files) shall be copied when restoring.
instance > sync > db false true Not in use yet
instance > sync > fs `pub/media Defines the paths, relative to instance > path  that shall be copied from the remote instance when restoring.
instance > sync > post_restore_actions > indexer
instance > sync > post_restore_actions > indexer > reindexAll true false Defines whether all indexes shall be rebuilt after restoring.
instance > sync > post_restore_actions > indexer > reindex elasticsuite_categories_fulltext
elasticsuite_thesaurus
Defines the indexes that shall be rebuilt after restoring.
instance > sync > post_restore_actions > commands bin/test Defines commands that are executed after restoring (will be executed in instance:path folder [src]).
instance > sync > post_restore_actions > sql_queries `UPDATE test SET a = 1 Defines SQL queries that are executed after restoring.
instance > crypt_key Defines the encryption key that will be written to app/etc/env.php when initializing the instance.
instance > config > system {} Defines scoped configuration entries that will be written to app/etc/env.php when initializing the instance.See below for supported scopes.
instance > config > system > default catalog: search: engine: elasticsearch7 elasticsearch7_server_hostname: 127.0.0.1 elasticsearch7_server_port: 9207 Defines a collection of arbitrary configurations that will be written to the default scope of the app/etc/env.php.Supports a nesting depth of 3.
instance > config > system > stores see above Defines a collection of arbitrary configurations that will be written to the stores scope of the app/etc/env.php.Supports a nesting depth of 3.
instance > config > system > websites see above Defines a collection of arbitrary configurations that will be written to the websites scope of the app/etc/env.php.Supports a nesting depth of 3.

Set up your project

To set up your project (aka initialize your instance) using an existing .valet-sh.yml, execute the following command

valet.sh init-instance

The documentation for this command can be found here.