- Install Vagrant and VirtualBox 5.1.26 (newer versions do not yet work with folder sync)
- Download or clone this repo
- Copy
default.config.ymltoconfig.ymland make the following modifications:- You can set the
vagrant_hostname,vagrant_machine_name, andvagrant_ipto whatever you like, which is useful if you are making multiple boxes for multiple sites - Point
local_pathto your local copy of a Pantheon site repo - You can change
destinationif you want, it's the path that will be on the Vagrant box - Set
drupal_core_pathto the same value you setdestinationabove - Change
php_versionto match the PHP version of the Pantheon site you're working on (most likely5.6)
- You can set the
- On the command line,
cdinto this project and runvagrant up - Make a copy of the database on the Vagrant box:
- Run
vagrant ssh- On Windows, this requires that you can run ssh from the command line - if this fails, try installing Chocolatey and running
choco install git -params "/GitAndUnixToolsOnPath"to quickly get ssh working
- On Windows, this requires that you can run ssh from the command line - if this fails, try installing Chocolatey and running
- Authenticate with Terminus
- Create a new backup if needed:
terminus backup:create[site].[environment]--element=db - Download the database backup:
curl -o mydb.sql.gz "$(terminus backup:get[site].[environment]--element=db)" - Create a database in MySQL
- Unzip the database backup into the database you just created:
gunzip < mydb.sql.gz | mysql -uroot -proot[database name] - Clean up the database backup files
- Run
- If you're not using the vagrant-hostsupdater or vagrant-hostmanager plugins, go to the
vagrant_ipin your browser (192.168.88.88 by default) and use the directions in the upper right corner to add the right info to your hosts file (C:\Windows\System32\drivers\etc\hostson Windows - must open editor as admin) - Go to the
vagrant_hostnamein your browser to see the site! 😎👍
Work on the files in your local copy of the Pantheon repo as normal and view your changes at vagrant_hostname in your browser.
Read about the different ways to stop the Vagrant box from running when you want to shut it down. Then simply go to the folder for this project again and run vagrant up to start it up again. If you ran vagrant destroy, you will need to create the database again.