Running a personal instance of the editor on Ubuntu

These are outline instructions on setting up the Numbas editor on a machine running Ubuntu 16.04+, for personal use. For instances where multiple users need access to the editor, we recommend following the Ubuntu web server installation instructions.

The Numbas editor uses Django, a web framework written in the Python programming language. Django has many configuration options, which we won’t detail here. For more information, consult the Django documentation.


  1. Install Git and Python 3 using the packaging system:

    apt install git python3


    If you already have two versions of Python installed on your PC, the command python might run the wrong version. The easiest way of making sure you use the right one is to create a virtual environment. Here’s how to do that:

    pip3 install virtualenv
    virtualenv -p python3 numbas_venv
    source numbas_venv/bin/activate

    You’ll need to activate the virtual environment each time you want to use it.

  2. Either download the Numbas runtime tools from GitHub and extract to a folder called numbas_runtime, or use git to clone the repository:

    git clone git:// numbas_runtime
  3. Either download the Numbas editor from GitHub and extract to a folder called numbas_editor, or use git to clone the repository:

    git clone git:// numbas_editor
  4. Install all the required Python modules:

    pip3 install -r numbas_editor/requirements.txt
    pip3 install -r numbas_runtime/requirements.txt


  • Run the “first setup” script:

    cd numbas_editor

    This will configure the editor based on your answers to a few questions, and write the file numbas/

    The default answers for most of the questions apply only to multi-user instances; make the appropriate changes using the paths described in the earlier steps.

    If you’ve followed these instructions exactly, you should use the following values:

    Path of the Numbas compiler


    Which database engine are you using?


    Where are static files stored?


    Where are uploaded files stored?


    Where are preview exams stored?


    Base URL of previews


    Title of the Site


    Allow new users to register themselves?


    Address to send emails from:

    (you can leave this blank)

    What domain will the site be accessed from?


    If you make any mistakes, you can run the script again, or edit numbas/ directly.

  • Start the server:

    python runserver
  • Open http://localhost:8000 in your web browser.

Ongoing maintenance

If you used git to clone the runtime and editor repositories, run the following commands to update your installation:

cd numbas_editor
git pull origin master
python migrate
pip install -r requirements.txt
cd ../numbas_runtime
git pull origin master
pip install -r requirements.txt

The admin site, where you can manually edit entries in the database, is at http://localhost:8000/admin.