Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

What does it do?

This vagrant configuration sets up a basic LAMP environment suited for Symfony 2 development:

  • Based on Ubuntu Lucid
  • Apache 2.2
  • PHP 5.3 with intl and readline, xdebug, sqlite extensions
  • phpMyAdmin
  • MySQL Server 5.1
  • Git and SVN clients


Install Vagrant

Obviously, you need Vagrant, which in turn requires Ruby and VirtualBox. Vagrant runs on Linux, OS X, and Windows, although some special configuration applies to Windows (see below).

Download and install a base image

$ vagrant box add base

This example uses the default Ubuntu image from the Vagrant project, although you can use other Ubuntu boxes if you like. If you do not name the box "base", you will later on need to adapt the Vagrantfile in the project root directory.

Setup a working directory and start your new environment

$ git clone git:// mydir
$ cd mydir
$ vagrant up

Depending on the versions of the box and your VirtualBox installation, you might see a notice that the guest additions of the box do not match the version of VirtualBox you are using. If you encounter any problems, you might want to install up to date guest additions on your box once running and repackage it for use with Vagrant.

If you prefer a clean URL, you might want to map to a local domain of your choice in your hosts file. This is entirely optional.

Use it


Vagrant will create two additional directories:

mydir/log/apache2 for Apache logs and mydir/project for your actual project files

Drop your Symfony 2 app into the mydir/project directory. Apache will use mydir/project/web as the web root.

The app is now accessible from your host system at


The setup will configure MySQL with a user/password of root/root. PhpMyAdmin is at

SSH and the Symfony console

Connect to your virtual machine:

$ vagrant ssh

Change to your project directory and launch the Symfony shell:

vagrant@vagrantup:~$ cd /vagrant/project
vagrant@vagrantup:~$ ./app/console -s


Vagrant will run on Windows without problems, although this is not tested with this specific configuration. As Windows does not offer NFS, you will however need to comment out the corresponding line in mydir/Vagrantfile.

If you want to use multiple instances of this virtual machine at the same time on a single host, you will need to edit the IP set in mydir/Vagrantfile to avoid conflicts.


A vagrant configuration creating a basic LAMP environment suited for Symfony 2 development







No packages published