Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 984a111

Browse files
author
Release Manager
committed
Trac #29545: document how to use Jupyter remotely
This ticket adds this to the documentation. Namely: {{{ ssh -L localhost:8888:localhost:8888 -t USER@REMOTE sage -n jupyter --no-browser --port=8888 }}} Previously discussed on [https://groups.google.com/forum/#!topic/sage- devel/eA4LLyHP99M sage-devel]. URL: https://trac.sagemath.org/29545 Reported by: gh-mwageringel Ticket author(s): Markus Wageringel Reviewer(s): Matthias Koeppe
2 parents 57b44a4 + 4a98a7a commit 984a111

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

src/doc/en/installation/launching.rst

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,46 @@ Notebook from the command line.
99

1010
If you did install the Windows version or the macOS application you
1111
should have icons available on your desktops or launching menus. Otherwise
12-
you are strongly advised to create shortcuts for Sage as indicated as the end
12+
you are strongly advised to create shortcuts for Sage as indicated at the end
1313
of the "Linux" Section in :ref:`sec-installation-from-binaries`. Assuming
14-
that you have this shortcut, running ``sage`` in a console starts a Sage
15-
session. To quit the session enter ``quit`` and then press ``<Enter>``. To
16-
start a Jupyter Notebook instead of a Sage console, run the command
17-
``sage -n jupyter`` instead of just ``sage``. To quit the Jupyter Notebook
18-
press ``<Ctrl> + <c>`` twice in the console where you launched the command.
14+
that you have this shortcut, running
15+
16+
.. CODE-BLOCK:: bash
17+
18+
sage
19+
20+
in a console starts a Sage session. To quit the session enter ``quit`` and
21+
then press ``<Enter>``.
22+
23+
To start a Jupyter Notebook instead of a Sage console, run the command
24+
25+
.. CODE-BLOCK:: bash
26+
27+
sage -n jupyter
28+
29+
instead of just ``sage``. To quit the Jupyter Notebook press ``<Ctrl> + <c>``
30+
twice in the console where you launched the command.
31+
32+
Using a Jupyter Notebook remotely
33+
---------------------------------
34+
35+
If Sage is installed on a remote machine to which you have ``ssh`` access, you
36+
can launch a Jupyter Notebook using a command such as
37+
38+
.. CODE-BLOCK:: bash
39+
40+
ssh -L localhost:8888:localhost:8888 -t USER@REMOTE sage -n jupyter --no-browser --port=8888
41+
42+
where ``USER@REMOTE`` needs to be replaced by the login details to the remote
43+
machine. This uses local port forwarding to connect your local machine to the
44+
remote one. The command will print a URL to the console which you can copy and
45+
paste in a web browser.
46+
47+
Note that this assumes that a firewall which might be present between server
48+
and client allows connections on port 8888. See details on port forwarding on
49+
the internet, e.g. https://www.ssh.com/ssh/tunneling/example.
50+
51+
------------------------------------------------------------------------
1952

2053
For further reading you can have a look at the other documents in the
2154
SageMath documentation at http://doc.sagemath.org/.

0 commit comments

Comments
 (0)