MediaWiki-Vagrant

Vagrant is a command-line tool for automatically provisioning virtual machines according to scripted specifications. The mediawiki-vagrant project bundles together specifications for quickly and easily provisioning a virtual machine running MediaWiki, suitable for development work.

Installation and Usage
VirtualBox and Vagrant are both prerequisite. Both are free and open-source.


 * 1) Download and install VirtualBox.
 * 2) Download and install the latest version of Vagrant from vagrantup.com.
 * 3) Download a copy of mediawiki-vagrant:
 * tarball, via Gerrit
 * zip file, via GitHub
 * Run

If you download the zip file or tarball, you will need to extract it to a directory of your choice. Once you do that, open up a terminal or a command-prompt, and change your working directory to the location of the extracted (or git-cloned) files. From there, run  to provision and boot the virtual machine.

You'll now have to wait a bit, as Vagrant needs to retrieve the base image from Canonical, retrieve some additional packages, and install and configure each of them in turn. Our Vagrant configuration relies on Puppet to provision and configure software. Here's what an initial run looks like. (The output you see may differ slightly.)

If it all worked, you should be able to browse to http://localhost:8080/ and see the main page of your MediaWiki instance.

To access a command shell on your virtual environment, run  from the root mediawiki-vagrant directory or any of its subdirectories. (Vagrant knows which instance you are referring to by searching for a file named 'Vagrantfile' in the current directory and its parent directories.)

From there, run  to interactively evaluate PHP code in a MediaWiki context, or   to get an authenticated SQL shell on your wiki's database.

Puppet failures
If Puppet fails to configure your machine,

This error may be caused by run-time failure to connect to Ubuntu package repositories or Gerrit. In such cases, you can simply trigger another Puppet run by running. If this doesn't work, you can try running  to trigger recreation of the virtual machine instance.

If your problem persists, please file a bug, and (if possible) attach a copy the output of the failed run.

Vagrant / VirtualBox failures
In general, Vagrant and VirtualBox get along quite well. Once in a blue moon, a VM crash in a way that causes Vagrant to lose the ability to manage the machine or inspect its status. If this should happen, you can usually fix things by running VirtualBox's management console and rebooting the machine there.