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

Commit c031379

Browse files
committed
29545: document how to use jupyter remotely
1 parent 10ed24e commit c031379

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

src/doc/en/installation/launching.rst

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,42 @@ 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+
------------------------------------------------------------------------
1948

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

0 commit comments

Comments
 (0)