Vagrant Docs


vagrant box add SOME_BOX  # downloads base VM
vagrant init SOME_BOX     # creates Vagrantfile with SOME_BOX as VM

or if I know which BOX I want:

vim Vagrantfile

Start and ssh

vagrant up
vagrant ssh        # log-in using Vagrant
vagrant ssh-config # info for external ssh log-in

When configuration in Vagrantfile is changed

vagrant reload

Synced folders

/vagrant in VM is synced with project root (where the Vagrantfile is)


Using shell script in the project root directory.

config.vm.provision :shell, path: ""

Provisioning proceedes:

  • first run of vagrant up
  • vagrant reload --provision
  • vagrant provision


Port-forwarding "forwarded_port", guest: 8080, host: 8080


vagrant suspend ➙ put to sleep

vagrant halt ➙ shut down

vagrant destroy ➙ remove the VM hard disk