Vagrant is a free command-line tool from HashiCorp for building and managing disposable virtual machine environments from a single text file. Sysadmins and DevOps engineers use it to spin up the same test server, lab or multi-VM setup on any laptop with one command, vagrant up, and throw it away just as easily with vagrant destroy.
Vagrant does not run virtual machines itself. It drives a hypervisor, called a provider: VirtualBox (the default), Hyper-V or Docker out of the box, and VMware Workstation/Fusion or libvirt through plugins. On top of that it handles networking, shared folders and provisioning with shell scripts, Ansible and other tools.
Vagrant at a glance
| Item | Details |
|---|---|
| Latest version | 2.4.9 (21 August 2025) |
| Licence | Free to use, source-available under the Business Source License 1.1 (production use allowed; not an OSI open-source licence) |
| Platforms | Windows (64-bit and 32-bit MSI), macOS (Intel and Apple Silicon), Linux (APT/RPM repositories and 64-bit binary) |
| Developer | HashiCorp, an IBM company |
| Official website | developer.hashicorp.com/vagrant (vagrantup.com redirects there) |
| Best for | Reproducible local test VMs and labs, testing Ansible roles and scripts, onboarding identical dev environments |
What it does
- Describes one or many VMs in a
Vagrantfile(Ruby syntax) that you keep in Git next to your code or playbooks. - Downloads and caches base images called boxes, per provider and CPU architecture.
- Configures port forwarding, private and public networks, and hostnames.
- Shares the project folder into the guest (
/vagrantby default) using the provider’s shared folders, rsync, NFS or SMB. - Provisions guests with shell scripts, Ansible (
ansibleoransible_local), Puppet, Chef, Salt or Docker. - Connects you with
vagrant ssh(or WinRM/PowerShell for Windows guests), and takes snapshots withvagrant snapshot. - Manages multi-machine labs, for example a web server, database and load balancer started together.
How sysadmins use it
A throwaway Ubuntu test server in two minutes
- Create a folder and a
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-24.04"
config.vm.hostname = "web01"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.56.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y nginx
SHELL
end- Run
vagrant up, then openhttp://localhost:8080orvagrant sshinto the VM. - Done testing?
vagrant destroy -fremoves the VM; the box stays cached for next time.
Test an Ansible role before it touches production
- Add the Ansible provisioner to the Vagrantfile:
config.vm.provision "ansible" do |ansible|
ansible.playbook = "site.yml"
end- On a Windows host, where Ansible cannot run natively, use
"ansible_local"instead; Vagrant installs Ansible inside the guest and runs it there. - Iterate with
vagrant provision; before a risky change,vagrant snapshot save cleanand roll back withvagrant snapshot restore clean.
Use Hyper-V on Windows
- Open PowerShell as Administrator (the Hyper-V provider requires it).
- Run
vagrant up --provider=hypervwith a box built for Hyper-V. - Pick the virtual switch when asked; the Hyper-V provider ignores the network settings in the Vagrantfile, and shared folders use SMB, so expect a credentials prompt.
Host your own boxes
- Package a VM you prepared:
vagrant package --output base-ubuntu.box. - Put the
.boxfile (and optionally a JSON metadata file listing versions and checksums) on an internal web server or file share. - Add it with
vagrant box add base-ubuntu https://boxes.example.local/base-ubuntu.box, or setconfig.vm.box_urlin the Vagrantfile.
Install and first run
Install a provider first (for example VirtualBox, or enable Hyper-V on Windows Pro/Enterprise), then Vagrant. On Windows run the MSI and reboot when asked; on macOS use the DMG for your CPU or brew install hashicorp/tap/hashicorp-vagrant; on Linux add HashiCorp’s APT or RPM repository and install the vagrant package. Check with vagrant --version.
Gotchas:
- Match the provider version to Vagrant: 2.4.9 added support for VirtualBox 7.2. Older Vagrant releases may refuse newer VirtualBox versions.
- On Windows, VirtualBox can run with Hyper-V enabled but may be slower; do not mix both providers on the same VM.
- On Apple Silicon Macs you need arm64 boxes and a provider that supports them; x86 boxes will not boot.
- For VMware Workstation or Fusion, install the Vagrant VMware Utility and then
vagrant plugin install vagrant-vmware-desktop. - Box registry change: HashiCorp is shutting down HCP Vagrant, the public box registry behind names like
bento/ubuntu-24.04. No new boxes can be created there from 1 October 2026, and all deployments are decommissioned on 31 December 2026. The Vagrant tool itself remains available; plan to host the boxes you depend on yourself.
Limitations
- No stable release since 2.4.9 in August 2025; development continues in dev builds, so check provider compatibility before upgrading your hypervisor.
- Full VMs are heavier and slower to start than containers.
- Public box availability after the registry shutdown depends on each box publisher.
- BSL licence: fine for internal and production use, but not open source in the OSI sense, and competing hosted offerings are restricted.
- Windows guests are large and slow to provision; licensing of Windows inside boxes is your responsibility.
Vagrant vs alternatives
Docker and other container tools start in seconds and suit application stacks, but they share the host kernel, so they do not replace a full test server with its own OS, services and reboot behaviour. Packer, also from HashiCorp, builds the images or boxes; Vagrant runs them. Terraform creates long-lived infrastructure in clouds and on hypervisors such as Proxmox VE; Vagrant is for local, disposable environments. If you only need a single VM now and then, a desktop hypervisor like VMware Workstation Pro (also a Vagrant provider) or QEMU with libvirt is enough without the automation layer. For configuring the VMs Vagrant creates, Ansible is the most common partner.
FAQ
Is Vagrant free for commercial use?
Yes. Vagrant is free to download and use, including in production, under the Business Source License 1.1; the restriction applies to offering it as a competing hosted or embedded product.
Is there a Vagrant download for Windows 11?
Yes, there is a 64-bit MSI installer for Windows, plus a 32-bit one. Install a provider such as VirtualBox or enable Hyper-V first.
Vagrant vs Docker: which should I use?
Use Docker for packaging and running applications; use Vagrant when you need a complete VM with its own kernel and OS, for example to test server configuration, Windows guests or reboots.
Vagrant vs VirtualBox: what is the difference?
VirtualBox is the hypervisor that runs the VM; Vagrant is the automation layer that creates, configures and provisions VMs on VirtualBox or another provider.
How do I SSH into a Vagrant VM?
Run vagrant ssh in the project folder. To use another client, vagrant ssh-config prints the host, port and key file.
How do I delete a Vagrant box?
vagrant box list shows cached boxes; vagrant box remove bento/ubuntu-24.04 deletes one and vagrant box prune removes old versions.
Is Vagrant open source?
The source code is public on GitHub, but it is licensed under the Business Source License 1.1, which is source-available rather than OSI-approved open source.
Last checked against official sources: 30 September 2026 (developer website: developer.hashicorp.com). Versions and licence terms change — confirm on the developer's site before deploying in production.






