I liked WAMP very much, but after discovering Vagrant I never will go back to WAMP.

What is Vagrant used for?

Create and configure lightweight, reproducible, and portable development environments.

In my words: Vagrant is used to simulate a real server environment to interact with.

In this article I want to share my basic setup.

Here is a quick introduction to vagrant if you don’t know what it is:


When I need a LAMP stack (on windows) for development, I use this vagrant box:


If gives you a web server environment (LAMP stack) with the following software already installed and configured:

  • Ubuntu
  • Apache
  • MySQL
  • PHP
  • PHPMyAdmin
  • Git

I usually create a new directory for my vagrant box and inside this directory a “html” directory which will be the server’s document root later.

cd c:\
mkdir vagrant-lamp
cd .\vagrant-lamp
mkdir html

Then I initialize my vagrant box with:

vagrant init avenuefactory/lamp

A short message appears, telling me that the Vagrantfile has been placed in this directory.

After this, I open the the Vagrantfile and add the following configurations at the end of this file (before “end”):

config.vm.network "private_network", ip: ""
config.vm.synced_folder "./html", "/var/www/html"

Those settings tell vagrant, to make the server available on this ip and to map the “./html” folder on my host system to my document root of my guest system (vagrant box).

If I want to change the memory limit:

config.vm.provider "virtualbox" do |vb|
  vb.memory = 1024

I can start the vagrant box by typing:

vagrant up

If this is the first time using this vagrant box, vagrant will download the box initially (will take some minutes).

Now I have a fully functional web server under:

I put my projects inside the “html” directory, and they are ready to work with.

To access the server with ssh, I start PuTTy (on a windows host) and enter the following connection details (vagrant will tell you all details in the command-line)

Port: 2222

user: vagrant
password: vagrant

When I am using a linux host, I just type:

vagrant ssh

To shutdown the server, I type:

vagrant halt

All other information about this vagrant box (connection to mysql, phpmyadmin) are written down here:


If you like, check out my own base box: https://atlas.hashicorp.com/alexwenzel/boxes/webdev

Categories: Development


Ty · 12/03/2015 at 23:13

The only problem with avenuefactory/lamp is that it doesn’t start Apache2 when it boots, and for whatever reason, I can’t find any way to make that work. No solutions I’ve found work. I can load it manually with apachectl start but I cant get it to load on boot. Period. Going with a different box 🙁

Comments are closed.