Skip to content
The Sage Cell Server---providing a way to embed Sage computations into any web page.
JavaScript Python HTML CSS CoffeeScript Makefile Other
Find file
Failed to load latest commit information.
contrib Install optional Sage package GIAC.
doc Remove option to use no syntax highlighting.
router-ipc Set up a router-ipc directory to house the AsyncSender ipc pipes.
static Strip output before printing.
submodules Upgrade CodeMirror to 5.0.0
templates Add support for adding provider info.
tests Make the interact test page served from the static directory, and mak…
timing Fix simple testing scripts for the new session id handling.
.gitignore Always open dialog below cursor; keep focus on textbox
.gitmodules Use MathJax from Sage.
LICENSE.txt Clarify the licensing situation, since we are importing Sage code in …
Makefile Use three.js package from Sage. Use three.js package from Sage. Use OutputHtml. Add SageCellComm class that basically resets the timeout anytime a co… Get rid of old command line arguments for worker's log file. Allow the user to create permalinks with interact values and bookmarks Make permalink database independent of Sage. Allow the user to create permalinks with interact values and bookmarks Implement readonly and locations parameters to interacts Add linear algebra exercise example. Use instead of wrap-jquery shell script Wait longer for forked kernels to respond. Add cone, cylinder, and box functions Template for the info block on root and help pages. Initial port of William's exercise string decorator Fix is_Vector/Matrix import for grid control detection. Catch all messages, not just ours and tornado. Add stream_message function Fix typo in namespace deletion Make permalinks work for Unicode: do NOT decode! Tweak upstart and drop database logging (does not work on shutdown an… Make R plots and files accessible. Set up a router-ipc directory to house the AsyncSender ipc pipes. Clean up trusted_kernel_manager Remove usage of default logger. Template for the info block on root and help pages.

This is SageMathCell - a Sage computation web service.

Please note that installation instructions below may be outdated. The most reliable source of build instructions at the moment is in contib/vm scripts.

Security Warning

If you are going to run a world accessible SageMathCell server, you must understand security implications and should be able to implement reasonable precautions.

The worker account (which is your own one by default) will be able to execute arbitrary code, which may be malicious. Make sure that you are securing the account properly. Working with a professional IT person is a very good idea here. Since the untrusted accounts can be on any computer, one way to isolate these accounts is to host them in a virtual machine that can be reset if the machine is compromised.

Simple Installation

We assume that you have access to the Internet and can install any needed dependencies (e.g. git). If you need to know more precisely what tools are needed, please consult the scripts for building virtual machine images in contib/vm scripts.

  1. Make sure you have a recent enough version of git: 1.8.5 is good enough, while 1.7.9 isn't.
  2. Install required npm packages:

    sudo apt-get install npm
    # On Debian based systems we need to make an alias
    sudo ln -s /usr/bin/nodejs /usr/bin/node
    sudo npm install -g inherits requirejs coffee-script
  3. Optionally create a directory for all components:

    mkdir sc_build
    cd sc_build
  4. Get and build Sage (export MAKE="make -j8" or something similar can speed things up):

    git clone
    pushd sage
    git checkout sagecell
    git submodule update --init --recursive
    ./sage -i threejs

    Note that we are building a special branch of Sage, do NOT use your regular Sage installation!

  5. Prepare Sage for SageMathCell:

    # We need IPython stuff not present in spkg.
    pushd sage/local/lib/python/site-packages
    rm -rf IPython*
    rm -rf ipython*
    git clone
    pushd ipython
    git checkout sagecell
    git submodule update --init --recursive
    ../sage/sage develop
    sage/sage -pip install --no-deps --upgrade ecdsa
    sage/sage -pip install --no-deps --upgrade paramiko
    sage/sage -pip install --no-deps --upgrade sockjs-tornado
    sage/sage -pip install --no-deps --upgrade lockfile
    sage/sage -pip install --no-deps --upgrade psutil
  6. Build SageMathCell:

    git clone
    pushd sagecell
    git submodule update --init --recursive
    ../sage/sage -sh -c "make -B"


  1. Go into the sagecell directory (you are there in the end of the above instructions).
  2. Copy to
  3. Edit according to your needs. Of particular interest are host and username entries of the _default_config dictionary: you should be able to SSH to username@host without typing in a password. For example, by default, it assumes you can do ssh localhost without typing in a password. Unless you are running a private and firewalled server for youself, you’ll want to change this to a more restrictive account; otherwise anyone will be able to execute any code under your username. You can set up a passwordless account using SSH: type “ssh passwordless login” into Google to find lots of guides for doing this, like You may also wish to adjust db_config["uri"] (make the database files readable only by the trusted account).
  4. Start the server via

    ../sage/sage [-p <PORT_NUMBER>]

    where the default <PORT_NUMBER> is 8888 and go to http://localhost:<PORT_NUMBER> to use the Sage Cell server.

    When you want to shut down the server, press Ctrl-C in the same terminal.


See the LICENSE.txt file for terms and conditions for usage and a DISCLAIMER OF ALL WARRANTIES.

Browser Compatibility

The Sage Cell Server is designed to be compatible with recent versions of:

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

If you notice issues with any of these browsers, please let us know.

Something went wrong with that request. Please try again.