Vagrant is one of the best known technologies for web development today.
For those not familiar with it, Vagrant is software for creating and configuring virtual development environments. So, it is closely related to virtualization software such asVirtualBox,VMware,Parallels, as well as others.
Vagrant Helps Development Teams Overcome Common Problems
Web development teams often face the same set of challenges and issues, including:
What happens when a new developer arrives? How long will it take to prepare a development environment?
Is the development environment the same as the production environment or quality assurance (QA) environment?
Do all the developers and QA developers have the same configuration on their machine? Do all of them have the same version of the main program language such as PHP, Python, Ruby or anything else?
How much unnecessary software or libraries are installed in the computers essential for the project? Are you sure there are no conflicts with the required libraries for development?
What if developers want to duplicate the development environment?
Vagrant helps dramatically simplify development environments to overcome these typical challenges. This blog post will now explain the basic concepts of Vagrant so you can start using it.
The basic concepts of Vagrant are:
Virtualization concepts: For customizing a virtual machine the most important concepts to start using Vagrant are networking (such as NAT, Host Only or Bridge mode), port forwarding, security such as firewall, and file permissions.
Base Boxes: Boxes are the package format for Vagrant environments. A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment.
Provisioners: Provisioners in Vagrant allow you to automatically install software, alter configurations, and more on the machine. This is useful since boxes typically aren’t built perfectly for your use case.
Share and synced folders: Synced folders enable Vagrant to sync a folder on the host machine to the guest machine, allowing you to continue working on your project’s files on your host machine, but use the resources in the guest machine to compile or run your project. By default, Vagrant will share your project directory (the directory with the Vagrantfile) to /vagrant.
Vagrantfile: The primary function of the Vagrantfile is to describe the type of machine required for a project, and how to configure and provision this machine. Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code. The syntax of Vagrantfiles is Ruby, but knowledge of the Ruby programming language is not necessary to make modifications to the Vagrantfile.
For any virtualization software, there are base boxes which are virtual machines with the essential libraries for an operating system.However, there are many alternatives such as Vortex, BoxGrinder and some others.
Now, with these basic concepts, you can start working with Vagrant, so let’s get ready for the next tutorial.