There's a ton of commands you can use to talk to Vagrant. For a full list see the official docs here, but I'll go over the more common ones.
vagrant up
vagrant up
: This is the command you just ran to boot the box up and provision the server based on the configuration file Vagrantfile. I use this for starting as well as resuming my environments.
vagrant suspend
vagrant suspend
Use this command to "pause" your virtual environment. Make sure you do this before shutting down your computer to safely be able to restore the environment later.
Starting, Pausing, and Resuming: To start or restore the environment you can just run vagrant up. The state will be saved and everything should be where you left it off from including your database changes.
vagrant destroy
vagrant destroy
: This permanently removes the virtual environment from your machine.
vagrant reload
vagrant reload
and vagrant reload --provision
If your environment suddenly stops working, it's useful to reboot by running this command. If you add the --provision
flag, it will reprovision the box as well.
vagrant ssh-config
vagrant ssh-config
: This lets you see the detailed login credentials of how you could connect to the virtual environment.
Like this article? Follow @whatnicktweets on Twitter