how to specify a port when running jupyter notebook

3,333 views
Skip to first unread message

J E Cremona

unread,
Feb 4, 2019, 4:58:36 AM2/4/19
to SAGE support
Is it possible to specify which port the jupyter notebook server runs on?  I think the default is 8888, but sometimes a different one is used (e.g.8889 if 8888 is in use).  I am running on a remote server so that other users may already be doing something on the default port.  In order to view the notebooks on my local machine's browser I use ssh-tunnelling and like to have the port numbers fixed in my ~/.ssh/config file.  This is awkward if I do not know in advance which port will be used.

John Cremona


--
Prof J E Cremona
Warwick Mathematics Institute
University of Warwick
http://www2.warwick.ac.uk/fac/sci/maths/people/staff/john_cremona/

Jan Groenewald

unread,
Feb 4, 2019, 5:01:46 AM2/4/19
to sage-support
Hi

On Mon, 4 Feb 2019 at 11:58, J E Cremona <J.E.C...@warwick.ac.uk> wrote:
Is it possible to specify which port the jupyter notebook server runs on?  I think the default is 8888, but sometimes a different one is used (e.g.8889 if 8888 is in use).  I am running on a remote server so that other users may already be doing something on the default port.  In order to view the notebooks on my local machine's browser I use ssh-tunnelling and like to have the port numbers fixed in my ~/.ssh/config file.  This is awkward if I do not know in advance which port will be used.


John Cremona

unread,
Feb 4, 2019, 5:16:24 AM2/4/19
to SAGE support
On Mon, 4 Feb 2019 at 10:01, Jan Groenewald <j...@aims.ac.za> wrote:
Hi

On Mon, 4 Feb 2019 at 11:58, J E Cremona <J.E.C...@warwick.ac.uk> wrote:
Is it possible to specify which port the jupyter notebook server runs on?  I think the default is 8888, but sometimes a different one is used (e.g.8889 if 8888 is in use).  I am running on a remote server so that other users may already be doing something on the default port.  In order to view the notebooks on my local machine's browser I use ssh-tunnelling and like to have the port numbers fixed in my ~/.ssh/config file.  This is awkward if I do not know in advance which port will be used.



Thanks:  I can confirm that adding --port=8889  to the command line (after sage -notebook=jupyter) does exactly what I needed.

Although this is obviously a jupyter thing and note a sage specific thing, I think it would be helpful to have this somewhere in the Sage documentation (I could not find it) and also visible in the "sage -h" output.

John
 

Regards,
Jan


--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Eric Gourgoulhon

unread,
Feb 4, 2019, 5:31:22 AM2/4/19
to sage-support
Le lundi 4 février 2019 11:16:24 UTC+1, John Cremona a écrit :

Although this is obviously a jupyter thing and note a sage specific thing, I think it would be helpful to have this somewhere in the Sage documentation (I could not find it) and also visible in the "sage -h" output.

It is visible by
sage -n jupyter -h
or equivalently
sage -n jupyter --help
I agree it would be better to have a link from both "sage -h" and "sage -n -h", or at least a setence like
run "sage -n jupyter -h" for all options relative to the Jupyter notebook.

Eric.
Reply all
Reply to author
Forward
0 new messages