Supported system:
VirtualBox is an open source virtualizer, an application that can run an entire operating system within its own virtual machine.
Stable version >= 5.2.0
Vagrant is an open source command line utility for managing reproducible developer environments.
Stable version >= 2.2.0
⚠ This vagrant installation is non-interactive: DO NOT USE SSH KEY WITH PASSPHRASE.
If your ssh key has been created with a passphrase, please create another one.
System | Steps |
---|---|
Windows | 1. Open UEFI BIOS and make sure virtualization is turned 'on' 2. Open powershell as administrator and run: Add-MpPreference -ExclusionProcess winnfsd.exe 3. Open C:\Windows\System32\drivers\etc\hosts as administrator then add network_ip and magento_url Default values would be: 192.168.60.0 dev.magento.com |
MacOs | 1. To avoid issue with guest additions, run:sudo apt install linux-headers-$(uname -r) |
Linux | 1. To install NFS properly, run:sudo apt install nfs-kernel-server |
Linux/MacOS | 2. Open /etc/hosts as sudo then add network_ip and magento_url Default values would be: 192.168.60.0 dev.magento.com |
git clone git@github.com:zepgram/magento2-fast-vm.git
ssh.example
rename it ssh
then put your id_rsa
and id_rsa.pub
keysconfig.yaml.example
rename it config.yaml
db-dump.sql.gz
.crypt_key
in config.yaml vagrant up
(duration: ~20 minutes)vagrant ssh
to access guest machineParent Node | Name | Default Value | Allowed Value | Is optional | Description |
---|---|---|---|---|---|
vmconf | machine_name | Vagrant Magento 2 | string | no | Vagrant machine name |
network_ip | 192.168.60.0 | IP address | no | Accessible IP address /etc/hosts | |
host_name | zepgram | string | no | Virtual host name | |
memory | 4096 | number | no | RAM allocated | |
cpus | 1 | number | no | CPU allocated | |
mount | nfs | nfs / rsync / default | no | Mount strategy | |
path | root | app / root | no | Mount whole directory or app/ only |
|
provision | all | all / system / magento | no | Define script provision | |
composer | username | magentoUsernameKey | string | no | Composer auth user |
password | magentoPasswordKey | string | no | Composer auth password | |
git | name | John Doe | string | yes | Git user name |
john@doe.com | yes | Git user email | |||
host | github.com | url | yes | Git host server name | |
repository | ssh://git@github.com:%.git | git repository | yes | Define repository to clone | |
magento | url | dev.magento.com | url | no | Magento site host name |
source | composer | composer / (master/develop..) | no | Define source installation. On git install set the branch name to clone. | |
edition | community | community / enterprise | no | Magento project edition | |
version | 2.4.5 | >=2.2 | no | Magento version release | |
php_version | default | default / 7.x / 8.x | no | PHP version | |
sample | true | true / false | no | Install sample data | |
mode | developer | developer / production | no | Magento execution mode | |
currency | USD | ISO 4217 | no | Default currency | |
language | en_US | ISO 639-1 + ISO 3166 | no | Default language | |
time_zone | America/New_York | timezone | no | Default timezone | |
crypt_key | - | string | yes | Crypt key form app/etc/env.php for db-dump.sql.gz (db import) | |
search_engine | opensearch | opensearch / elasticsearch | false | Search engine for catalog search | |
disable_two_factor_auth | true | true / false | false | Disable 2 factor authentication for admin access |
Only useful on path set to root
.
root
and get performance equal to an app
mount.vagrant rsync-auto
is launched by default on vagrant up, even with that if you need to force an update you can run vagrant rsync
. Terminal should be kept open for rsync-auto: do not close it.composer update
for example, you can run vagrant rsync-back
to push files from guest to host.vagrant reload
to enable file watching with rsync-auto.Recommended for root
and app
path.
The most stable option, config has been made to ensure compliance with all OS.
Less performant than rsync but files are perfectly shared between guest and host machine.
It can be used with app
path if you encountered any issue with NFS and rsync mount.
You can add extra shell provisions.
Those provisions will be executed on pre-defined sequences:
extra/001-env.sh
his purpose is to provide extra environment variables or extra package, executed after script 001-system-env.sh
extra/100-pre-build.sh
define your specific system configuration before installation, executed after script 100-magento-pre.sh
extra/120-post-build.sh
you can execute magento command in this sequence, executed after script 120-magento-post.sh
-example
from the filename script.100-pre-build.sh
Magento file system owner is configured for vagrant
user, it means all commands in magento project must be executed by this user.
By default command line vagrant ssh
will log you as vagrant user.
permission
directly in command line.Enable cron:
./bin/magento cron:install
Disable cron:
./bin/magento cron:remove
Percona server 8.0 is now installed for Magento >=2.4.0
Lower versions are handled foreach existing Magento versions.
PHP 8.2 is now installed by default for Magento >=2.4.6
Lower versions are handled foreach existing Magento versions.
Composer v2 is now installed by default for Magento >=2.4.2
Lower versions are handled foreach existing Magento versions.
Version 8.4.x of Elasticsearch is now available for Magento 2.4.6
Version 7.6.x of Elasticsearch is available for version between 2.4.0 and 2.4.5
Lower versions are handled foreach existing Magento versions
Otherwise, you can also completely disable elasticsearch by installing this module: https://github.com/zepgram/module-disable-search-engine
Version 2.5.x is now available for Magento 2.4.6
Elasticsearch will be installed by default on lower Magento versions.
There is a known issue with composer installation on windows 10.
This issue could not be solved yet, and has already been reported 2 times.
To solve this, I recommend to set mount option to "rsync", then after full installation you should be able to fall back to NFS.
If you have trouble during installation please open a new issue on this GitHub repository.