Complete Vagrant commands reference — 29 commands across 1 categories. Quick reference cheat sheet for Cross-platform.
Vagrant has a small command set and one file, the Vagrantfile, that defines the machine; the commands below are the whole lifecycle. The descriptions are HashiCorp's own, and the notes pick out the order you actually run them in and the two commands people forget exist.
| Shortcut | Action |
|---|---|
| vagrant box | Manage "vagrant box add", "vagrant box remove", and other box-related commands such as |
| vagrant cloud | Taking actions against Vagrant Cloud like searching or uploading a Vagrant Box |
| vagrant connect | Compliments the "vagrant share" command to allow a user to remotely connect to your Vagrant |
| vagrant destroy | Stop the running virtual machine and terminate use of all resources that were in use |
| vagrant global-status | Determine the state of all active Vagrant environments on the system for the currently logged |
| vagrant halt | Shut down the virtual machine that Vagrant is currently managing |
| vagrant init | Initialize the current directory to be a Vagrant environment by creating an initial Vagrantfile |
| vagrant login | Authenticate Vagrant with HashiCorp's Vagrant Cloud service to use features like private boxes |
| vagrant machine-readable | Almost all commands in Vagrant accept a --machine-readable flag to enable machine-readable |
| vagrant non-primary | In addition to the commands listed in the sidebar and shown in "vagrant -h", Vagrant comes |
| vagrant package | Package a currently-running VirtualBox or Hyper-V vagrant environment into a reusable Vagrant |
| vagrant plugin | Manage Vagrant plugins including installing, uninstalling, and license management |
| vagrant port | Display the full list of guest ports mapped to the host machine ports |
| vagrant powershell | Open a PowerShell prompt running inside the guest machine |
| vagrant provision | Run any provisioners configured for the guest machine, such as Puppet, Chef, Ansible, Salt |
| vagrant rdp | Start an RDP client for a remote desktop session with the guest machine |
| vagrant reload | Is the equivalent of running "vagrant halt" followed by "vagrant up" |
| vagrant resume | Bring a machine back into the "up" state, perhaps if it was previously suspended via "vagrant |
| vagrant share | Initializes a new Vagrant share session, which allows you to share your virtual machine |
| vagrant snapshot | Manage snapshots of the guest machine |
| vagrant ssh | Establish an SSH session into a running virtual machine to give you shell access |
| vagrant ssh-config | Output a valid SSH configuration file capable of SSHing into the guest machine directly |
| vagrant status | Tell you the status of the virtual machines in the current Vagrant environment |
| vagrant suspend | Suspend the guest machine Vagrant is currently managing |
| vagrant up | Create, configuration, and provision a guest machine according to your Vagrantfile |
| vagrant upload | Upload files from the host to a guest machine |
| vagrant validate | Validate your Vagrantfile |
| vagrant version | Output the version of Vagrant currently installed on the system |
| vagrant winrm | Execute commands on the remote machine via WinRM |
vagrant init writes a starter Vagrantfile in the current directory; edit it to pick a box and a provider, then vagrant up downloads the box if needed, creates the VM and runs provisioners. vagrant ssh logs in. vagrant halt shuts the VM down cleanly and vagrant suspend saves its state to disk so vagrant resume brings it back in seconds. vagrant destroy deletes the VM and its disk; the box file stays, so the next up is fast.
Edits to the Vagrantfile take effect with vagrant reload, which is halt followed by up and re-reads the configuration. Provisioners run only on first up by default; vagrant provision re-runs them on a running machine, and vagrant reload --provision does both. vagrant port lists which guest ports are forwarded to which host ports, which answers most "why can't I reach the app" questions.
vagrant global-status lists every Vagrant environment on the machine, including ones in directories you have forgotten, with their IDs — and any command accepts that ID, so vagrant destroy <id> cleans up a VM from anywhere. vagrant box manages downloaded box images (list, update, prune), which is where the disk space goes. vagrant package turns a configured VM into a reusable box for the rest of a team.
halt shuts the VM down; suspend saves its memory state for a fast resume; destroy deletes the VM entirely, keeping only the box image.
Run vagrant reload. A running machine does not re-read the Vagrantfile until it is restarted.
vagrant global-status lists them all with IDs you can pass to any command.
vagrant provision on a running machine, or vagrant up --provision / vagrant reload --provision.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"