Vagrant
Vagrant is an open-source tool for building and managing virtualized development environments. It provides a simple and consistent workflow for creating reproducible and portable environments, making it easier for developers to work on projects across different operating systems.
π Key Featuresβ
- Reproducibility: Define environments as code using a
Vagrantfile
. - Portability: Works with multiple providers (VirtualBox, VMware, Hyper-V, Docker).
- Provisioning: Supports shell scripts, Ansible, Chef, Puppet, and more for automated setup.
- Isolation: Each project can have its own isolated environment.
- Community: Large ecosystem of pre-built boxes and plugins.
π Common Commandsβ
vagrant init
β Initialize a new Vagrant environment.vagrant up
β Start and provision the environment.vagrant halt
β Stop the running machine.vagrant destroy
β Remove the environment.vagrant ssh
β SSH into the running machine.
π Useful Linksβ
- Vagrant - Development Environments Made Easy
- Vagrant GitHub
- Vagrant CLI autocompletion
- vagrant-disksize - A Vagrant plugin to resize disks in VirtualBox
- Vagrant Boxes - Pre-built base images
π Notesβ
- Vagrant is ideal for development and testing, not for production.
- The
Vagrantfile
is the core configuration file for defining environments. - Plugins extend Vagrantβs functionality (e.g., for disk resizing, synced folders, etc.).