Skip to content

Instantly share code, notes, and snippets.

@malinky
Last active December 19, 2018 10:51
Show Gist options
  • Save malinky/a16340195468eb8f26365c6ca3576b14 to your computer and use it in GitHub Desktop.
Save malinky/a16340195468eb8f26365c6ca3576b14 to your computer and use it in GitHub Desktop.
Vagrant

VAGRANT

Boxes

A Vagrant box is a base image that clones a virtual machine, for example an ubuntu server or a server containing everything to run a Laravel project.

Add a box to your computer vagrant box add VENDOR\BOXNAME.

Remove a box from your computer vagrant box remove VENDOR\BOXNAME.

Boxes are saved in ~/.vagrant.d/boxes.

Assign the box in the project Vagrantfile config.vm.box property.

Commands

Start the machine specified in the project Vagrantfile vagrant up.

Pause the machine in it's current state vagrant suspend.

Shut the machine down vagrant halt. The machine is still available and can be restarted with vagrant up.

Restart the machine vagrant reload. This is equivalent to vagrant halt, vagrant up.

Use vagrant reload after a change to the Vagrantfile. Force the provisioners with --provision flag as the provisioners only run on the first up that creates the environment.

Quickly run the provisioners vagrant provision.

Destroy the machine vagrant destroy. This will remove entirely including all databases.

Provisioning

Install software and configure the machine during the up process. This only runs on the first up that creates the environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment