Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

263 lines (169 sloc) 9.04 KB


Core developers run Kuma in a Vagrant-managed virtual machine so we can run the entire MDN stack. (Django, KumaScript, Search, Celery, etc.) If you're on Mac OS X or Linux and looking for a quick way to get started, you should try these instructions.


If you have problems getting vagrant up, check Errors below.

Install and run everything

  1. Install VirtualBox >= 4.2.x from


    (Windows) After installing VirtualBox you need to set PATH=C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe;

  2. Install vagrant >= 1.7 using the installer from

  3. Install Ansible on your machine so that Vagrant is able to set up the VM the way we need it.

    See the Ansible Installation docs for which way to use on your computer's platform.

    The most common platforms:

    Mac OS X:

    brew install ansible

    or if you have a globally installed pip:

    sudo pip install ansible


    $ sudo apt-get install software-properties-common
    $ sudo apt-add-repository ppa:ansible/ansible
    $ sudo apt-get update
    $ sudo apt-get install ansible

    Fedora / RPM-based distribution:

    $ sudo dnf install ansible.noarch

    For previous versions based on yum, use:

    $ sudo yum install ansible.noarch


    Installation on Windows is complicated but we strive to make it easier in the future. Until then see this blog post for how to Run Vagrant with Ansible Provisioning on Windows

  4. Fork the project. (See GitHub)

  5. Clone your fork of Kuma and update submodules:

    git clone<your_username>/kuma.git
    cd kuma
    git submodule update --init --recursive
  6. Start the VM and install everything. (approx. 15 minutes on a fast net connection).:

    vagrant up


    VirtualBox creates VMs in your system drive. Kuma's VM is approx. 2GB. If it won't fit on your system drive, you will need to change that directory to another drive.

    At the end, you should see:

    Finished catalog run in .... seconds

    If the above process fails with an error, check Errors.

  7. Log into the VM with ssh:

    vagrant ssh
  8. Use foreman inside the VM to start all site services:

    foreman start

    You should see output like:

    20:32:59 web.1        | started with pid 2244
    20:32:59 celery.1     | started with pid 2245
    20:32:59 kumascript.1 | started with pid 2246
    20:32:59 stylus.1     | started with pid 2247
  9. Visit and add an exception for the security certificate if prompted.

  10. Visit the homepage at

  11. You've installed Kuma! If you want the badge please email a screenshot of your browser to receive the badge.

    Continue reading to create an admin user and enable the wiki.

Create an admin user

You will want to make yourself an admin user to enable important site features.

  1. Sign up/in with Persona

  2. After you sign in, SSH into the VM and make yourself an admin (exchange << YOUR_USERNAME >> with the username you used when signing up for Persona):

    vagrant ssh
    mysql -ukuma -pkuma kuma -e "UPDATE auth_user set is_staff = 1, is_active=1, is_superuser = 1 WHERE username = '<< YOUR_USERNAME >>';"

    You should see:

    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1  Changed: 1  Warnings: 0

Enable the wiki

By default, the wiki is disabled with a :doc:`feature toggle <feature-toggles>`. So, you need to create an admin user, sign in, and then use the Django admin site to enable the wiki so you can create pages.

#. As the admin user you just created, visit the waffle section of the admin site.

  1. Click "Add flag".
  2. Enter "kumaediting" for the Name.
  3. Set "Everyone" to "Yes"
  4. Click "Save".

You can now visit to create new wiki pages as needed.

Many core MDN contributors create a personal User:<username> page as a testing sandbox.

(Advanced) Enable KumaScript

By default, KumaScript is also disabled with a :doc:`feature toggle <feature-toggles>`. To enable KumaScript:

  1. Sign in as the admin user
  2. Visit the constance config admin panel
  3. Change KUMASCRIPT_TIMEOUT to 600
  4. Click "Save" at the bottom

KumaScript is now enabled. You will also need to import the KumaScript auto-loaded modules. You can simply copy & paste them from the production site to your local site at the same slugs. Or you can get a .json file to load in your local django admin interface as described in `this bugzilla comment`_.

(Advanced) Enable GitHub Auth

To enable GitHub authentication ...

Register your own OAuth application on GitHub:

As the admin user, add a django-allauth social app for GitHub:

  • Provider: GitHub
  • Name:
  • Client id: <your GitHub App Client ID>
  • Secret key: <your GitHub App Client Secret>
  • Sites: -> Chosen sites

Now you can sign in with GitHub at

Errors during vagrant up

vagrant up starts the virtual machine. The first time you run vagrant up it also provisions the VM - i.e., it automatically installs and configures Kuma software in the VM. We provision the VM with Ansible roles in the provisioning directory.

Sometimes we put Ansible roles in the wrong order. Which means some errors can be fixed by simply provisioning the VM again:

vagrant provision

In some rare occasions you might need to run this multiple times. If you find an error that is fixed by running vagrant provision again, please email us the error at and we'll see if we can fix it.

If you see the same error over and over, please ask for :ref:`more help <more-help>`.

Django database migrations

If you see errors that have "Django database migrations" in their title try to manually run them in the VM to see more about them. To do so:

vagrant ssh
python migrate

If you get an error, please ask for :ref:`more help <more-help>`.


On Ubuntu, vagrant up might fail after being unable to mount NFS shared folders. First, make sure you have the nfs-common and nfs-server packages installed and also note that you can't export anything via NFS inside an encrypted volume or home dir. On Windows NFS won't be used ever by the way.

If that doesn't help you can disable NFS by setting the VAGRANT_NFS configration value in a .env file. See the :ref:`Vagrant configuration <vagrant-config>` options for more info.

If you have other problems during vagrant up, please check :doc:`Troubleshooting <troubleshooting>`.

Jump to Line
Something went wrong with that request. Please try again.