Skip to content

Instantly share code, notes, and snippets.

@anilshrish
Forked from wpscholar/vagrant-cheat-sheet.md
Created April 7, 2019 03:20
Show Gist options
  • Select an option

  • Save anilshrish/45438a4c24d2a784ebde89f16b122a8a to your computer and use it in GitHub Desktop.

Select an option

Save anilshrish/45438a4c24d2a784ebde89f16b122a8a to your computer and use it in GitHub Desktop.
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Common Vagrant Commands

  • vagrant up starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status outputs status of the vagrant machine
  • vagrant global-status outputs status of all vagrant machines
  • vagrant halt stops the vagrant machine
  • vagrant reload restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision forces reprovisioning of the vagrant machine
  • vagrant ssh connects to machine via SSH
  • vagrant destroy stops and deletes all traces of the vagrant machine

Tips

  • vagrant -v Get the vagrant version
  • vagrant suspend Suspends a virtual machine (remembers state)
  • vagrant resume Resume a suspended machine (vagrant up works just fine for this as well)
  • vagrant reload --provision Restart the virtual machine and force provisioning
  • vagrant push Vagrant can be configured to deploy code!
  • vagrant up --provision | tee provision.log Runs vagrant up, forces provisioning and logs all output to a file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment