1

I have been asked to look into installing SageMath on a server for use by multiple users (I am a sysadmin and not a mathematician). I had initially looked into this a couple of years ago, but then priorities were changed.

From the previous occasion, I recall that SageMath installation is generally from a tarball (or a possibly quite fearsome compilation from source), and that the SageMath notebook interface runs in the user's web browser. I seem to recall then that it would be difficult or impossible for more than one end user to run SageMath, as, when it opens a web browser, it is not aware of there actually being different end users on a multi-user server computer and the notebook interface would not be able to cope with this (without somehow running multiple web interfaces on separate network ports?). The SageMath documentation also rather seems to assume the use case of an individual user with sysadmin powers installing SageMath on their own personal computer for their own stand-alone personal use (if there is specific documentation about setup for multiple users, I have not yet found it, unfortunately).

Is it (easily) possible to install SageMath on a (Linux) server for multiple end users to be able to use it via the notebook interface, or would it realistically be substantially easier to consider the use of the SageMath Cloud service instead?

(If we proceed to try to install SageMath ourselves, we have no particular distro preference for the server that would host this: we use both Scientific Linux (marginally preferred at an organisational level) and Ubuntu/Debian servers as appropriate, depending on which is better supported by developers of the various "grassroots" packages that we need to use (increasingly often, Ubuntu/Debian (marginally preferred personally(!)).)

Thank you for any advice.

  • 1
    What distribution are you using? SageMath is available in some distributions’ repositories, ready to install. – Stephen Kitt May 4 '17 at 10:59
  • 1
    Thanks for the prompt: I have updated the question, but unfortunately I am not sure if the availability of packages would make much difference: from my skim-reading of SageMath documentation (and some previous experimentation), once installed, it is just not clear whether the SageMath notebook can really be used by different users on a multi-user system, as how its web (notebook) interface deals with the concept of multiple users is not clear. – dave559 May 4 '17 at 11:38
  • As Stephen says, Sage is available for Debian testing and later. Backports should be possible, though possibly not trivial. Sage is mostly Python, right? – Faheem Mitha May 4 '17 at 12:58
  • Regarding "would it realistically be substantially easier to consider the use of the SageMath Cloud service instead?" you can also use SageMathCloud locally via a premade Docker image. github.com/sagemathinc/smc/blob/master/src/dev/docker/README.md – William Stein May 6 '17 at 12:02
2

SageMath has its own user accounts system for notebooks. Once you’ve installed SageMath (I tested with apt install sagemath in Debian 9, once it’s released, or Ubuntu 17.04), you should create a system user dedicated to running sage, start sage as that user, then run

notebook(interface = '', secure=True)

This will prompt you to specify an admin password, and the hostname; then it will start the web server (with an initial browser). You can connect to port 8082 on the system running the notebook, login as “admin” with the password you just gave, and from there you’ll be able to add more users (“Settings”, “Manage Users”).

Turning this into a properly-managed service is left as an exercise for the reader... In SageMath, notebook? will display the notebook documentation with a lot more info on the various options available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.