Virtual Box, Vagrant and VVV
For working remotely, it is beneficial to set up a local server on your own machine at home to allow you to run sites smoothly for testing purposes, or while being away from the office.
- Download and install VirtualBox. This will allow virtual machines to be set up on your computer. A virtual machine is used to run the server software.
- Download and install Vagrant. This is the software that utilizes VirtualBox to create a functioning server on your machine.
- In your command line terminal, run the following command:
vagrant plugin install vagrant-hostsupdater
- Again in the terminal, run this command to clone the VVV repo to your machine. Change [YOUR_DIRECTORY] with the name you would like for your server directory:
git clone -b master git://github.com/Varying-Vagrant-Vagrants/VVV.git ~/[YOUR_DIRECTORY]
- In your file explorer, open that directory and copy the
vvv-config.ymlfile. Rename the duplicate
- In your terminal, cd into your newly created server directory. Run:
- It should take a few minutes to provision the server for the first time. Once that process is complete, the server will be up and running. Be sure to shut it down when you are done using it by running:
Adding New Sites
To add a new site to your local server, open up your file explorer, navigate to your server directory and open up the vvv-custom.yml file. Between lines 37 and 41, you will see this code commented out:
In your terminal, cd into the server directory. Run the following:
vagrant up --provision
vvv-custom.ymlfile). It should only take a couple of minutes for the server to be up and running again and then you should have access to the newly added URL.