Follow us on Youtube.  | Follow Website !

Search Suggest


How to set up the Vagrant WordPress development environment

How to set up the Vagrant WordPress development environmentThere are many ways to set up a local development environment to help you test your new WordPress project. However, lots of tools are heavy on resources. On the other hand, setting up a lighter test environment manually will be difficult. Using the Vagrant WordPress 'box' provides a good foundation between the two.

In a nutshell, Vagrant lets you set up a testing environment with very little cost. This means you can run several unique environments side by side using different configurations, even on modest hardware.

Here, we will introduce you to the Vagrant environment and how the box system works. Next, we will show you how to set up the WordPress Vagrant environment.

What is Vagrant and why is it a great tool for WordPress development?)


At its core, Vagrant is a tool for managing virtual machines. You provide machines that use VirtualBox, VMware, even online services, such as Amazon Web Services (AWS).

Vagrant works by using the command line to set up the box. You then configure and interact with this box via the command line, as well as using your favorite text editor, browser, any other tools that you have installed on your computer.

The Vagrant environment tends to be very lightweight compared to full virtual machines. What's more, you quickly set up an environment ready to use the box that other users share, with lots of options to choose from.


The best part of using Vagrant is to easily share your configuration file or box with other team members. This means that everyone on your team has the same development environment to work with, even if you use the same operating system (OS) or other settings.

When it comes to WordPress, there are many Vagrant built-in environments that you can use. Let's see how the process works.

How to set up the WordPress Vagrant development environment (in 3 steps)

Step 1: Install VirtualBox and Vagrant


Because you use Local Vagrant, you need a program that allows you to set up a new virtual machine. VirtualBox is the recommended Vagrant software, both programs work together.

First, you will want to install the version of VirtualBox that is suitable for your operating system. After the software is set up, continue installing Vagrant. Once you're done, open the command line and type the following:

vagrant -v

This is a small test to see if Vagrant is working properly. If you do not see the message confirming the current version of Vagrant is installed on your system, restart your computer and try again.

Once you have confirmed that Vagrant is working, it is time to set up your WordPress environment.

See more: How to create a form in wordpress

Step 2: Install the WordPressVagrant box

Instead of setting up the entire environment from scratch, you get to work right away using the built-in WordPress configuration. There are many options for the Vagrant WordPress box, but it is recommended to use VCCW, this is an environment built to develop the interface with the plugin.


VCCW comes with Ubuntu, version control for Git, the latest version of WordPress, WP-CLI, PHP 7, MySQL, Apache, and more.

To get started, you will need two things:

  • Vagrant Box VCCW
  • Installation file inside it

First, run the following command at Terminal:

vagrant box add vcc-team / xenial64

Now download the latest configuration guide with the new Vagrant WordPress environment with you. It weighs less than 20 Kb, this makes it easy to recreate the environment with Vagrant.

Once you have the file, set up your new local directory with your environment and move the zip file inside. Next, move into this environment using the command line

cd nameofthenewdirectory

When you are in the environment in the command line, enter the following:

vagrant up

The vagrant up command tells the new virtual machine on your side to start using the instructions from the file in its directory. Because this is the first time your device is working, it will take a bit for Vagrant to set everything up.

Once your Vagrant WordPress box is ready, you will reuse the command line and check if everything works correctly.

Step 3: Check your new local WordPress installation


When your VCCW box works, you will access it from your browser using either of the following addresses:

  • http: //vccw.test

If everything works correctly, log in to WordPress using 'admin' as your username and password. This is not a combination that should be used in the normal case, but for the local test environment, it is not a big deal.

When we touch, VCCW will automatically set up the MySQL database with your local website. To access it, you access port 3306 through your browser. This is the default login information:

Username: 'wordpress' or 'root'

Password: wordpress

Because Vagrant doesn't provide you with an intuitive interface with a virtual machine on your side, you'll need to rely on SSH to edit any files outside of WordPress.

You access the box via SSH using either of its URLs as the hostname. Both username and password will be set to 'vagrant' by default:


Once you're connected to your box, you can make any changes you want to it with the command line. If you don't feel comfortable editing the file this way, now is a great time to learn as you have the perfect testing environment to do so!


Vagrant is a far cry from the only tool you use to develop WordPress locally. Other popular options are:

  • Local by Flywheel
  • Docker
  • DesktopServer

However, the Vagrant WordPress environment is very light and easy to replicate, they are perfect for collaboration.

Once you have set up and run the WordPress Vagrant environment, you can use it for the purpose of staging, testing or working on a new project.

Post a Comment