Changing the default port for iPython notebook server / Jupyter

jonhurlock

I am trying to run an ipython notebook / jupyter server on a machine behind a firewall. The only port which is open is port 80. So was wondering how I can change the default port from 8890 to 80?

I have ran the following command ipython profile create to create a profile.

Then edited ipython_notebook_config.py and edited it to contain the following:

c = get_config()
c.NotebookApp.port = 80

When I try to run python notebook. I get the following error:

ERROR: the notebook server could not be started because no available port could be found.


Hoever, nothing else seems to be using port 80. Apache does not boot at startup and is disabled. I have even used netstat to see what is using each port.

$ sudo netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address                 State       PID/Program name
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      1226/vsftpd     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1532/sshd       
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      3433/cupsd      
tcp        0      0 127.0.0.1:5984          0.0.0.0:*               LISTEN      1410/beam.smp   
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1653/mysqld     
tcp6       0      0 :::22                   :::*                    LISTEN      1532/sshd       
tcp6       0      0 ::1:631                 :::*                    LISTEN      3433/cupsd      
udp        0      0 0.0.0.0:52741           0.0.0.0:*                           796/avahi-daemon: r
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           796/avahi-daemon: r
udp        0      0 0.0.0.0:31114           0.0.0.0:*                           1105/dhclient   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1105/dhclient   
udp        0      0 xxx.xxx.xxx.xxx:123        0.0.0.0:*                           2607/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           2607/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           2607/ntpd       
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1630/cups-browsed
udp6       0      0 :::5353                 :::*                                796/avahi-daemon: r
udp6       0      0 :::69                   :::*                                1607/in.tftpd   
udp6       0      0 :::24682                :::*                                1105/dhclient   
udp6       0      0 xxxx::xxxx:xxxx:xxxx:123 :::*                                2607/ntpd       
udp6       0      0 ::1:123                 :::*                                2607/ntpd       
udp6       0      0 :::123                  :::*                                2607/ntpd       
udp6       0      0 :::59559                :::*                                796/avahi-daemon: r
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     20483    3253/pulseaudio     /run/user/1003/pulse/native
unix  2      [ ACC ]     STREAM     LISTENING     18697    3179/gnome-session  @/tmp/.ICE-unix/3179
unix  2      [ ACC ]     STREAM     LISTENING     15765    2507/X              /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     20481    3253/pulseaudio     /tmp/.esd-1003/socket
unix  2      [ ACC ]     STREAM     LISTENING     18698    3179/gnome-session  /tmp/.ICE-unix/3179
unix  2      [ ACC ]     STREAM     LISTENING     15764    2507/X              @/tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     10538    768/bluetoothd      /var/run/sdp
unix  2      [ ACC ]     STREAM     LISTENING     21564    3433/cupsd          /var/run/cups/cups.sock
unix  2      [ ACC ]     STREAM     LISTENING     10820    1653/mysqld         /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     16666    3184/dbus-daemon    @/tmp/dbus-1gowauBlhV
unix  2      [ ACC ]     STREAM     LISTENING     14432    748/dbus-daemon     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     8877     1/init              @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     16698    3136/ibus-daemon    @/tmp/dbus-ue1VKkXx
unix  2      [ ACC ]     STREAM     LISTENING     12135    3005/gnome-keyring- /run/user/1003/keyring-htUkSg/control
unix  2      [ ACC ]     STREAM     LISTENING     14469    796/avahi-daemon: r /var/run/avahi-daemon/socket
unix  2      [ ACC ]     STREAM     LISTENING     10034    3102/dbus-daemon    @/tmp/dbus-SCYaEa0Hje
unix  2      [ ACC ]     STREAM     LISTENING     18577    3005/gnome-keyring- /run/user/1003/keyring-htUkSg/pkcs11
unix  2      [ ACC ]     STREAM     LISTENING     18581    3005/gnome-keyring- /run/user/1003/keyring-htUkSg/gpg
unix  2      [ ACC ]     STREAM     LISTENING     18583    3005/gnome-keyring- /run/user/1003/keyring-htUkSg/ssh
unix  2      [ ACC ]     STREAM     LISTENING     18569    3007/init           @/com/ubuntu/upstart-session/1003/3007
unix  2      [ ACC ]     SEQPACKET  LISTENING     11473    396/systemd-udevd   /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     10725    1572/acpid          /var/run/acpid.socket
Shankar ARUL
ipython notebook --ip=0.0.0.0 --port=80 or
jupyter notebook --ip=0.0.0.0 --port=80

is what i did to run ipython in my vagrant box. (Opened up the ports on the vagrant box to access it on my host mac)

usage: ipython [-h] [--certfile NOTEBOOKAPP.CERTFILE] [--ip NOTEBOOKAPP.IP]
               [--pylab [NOTEBOOKAPP.PYLAB]]
               [--log-level NOTEBOOKAPP.LOG_LEVEL]
               [--port-retries NOTEBOOKAPP.PORT_RETRIES]
               [--notebook-dir NOTEBOOKAPP.NOTEBOOK_DIR]
               [--config NOTEBOOKAPP.CONFIG_FILE]
               [--keyfile NOTEBOOKAPP.KEYFILE] [--port NOTEBOOKAPP.PORT]
               [--transport KERNELMANAGER.TRANSPORT]
               [--browser NOTEBOOKAPP.BROWSER] [--script] [-y] [--no-browser]
               [--debug] [--no-mathjax] [--no-script] [--generate-config]

Incase the port is already occupied, see what's blocking it - inmy case it was an old instance of ipython which had not been terminated properly. I kiiled them all with this command

ps auxww | grep 'ipython' | awk '{print $2}' | xargs sudo kill -9

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Default template for iPython notebook (using Jupyter)

From Dev

IPython/Jupyter notebook 3 - hide headers by default

From Dev

How to change the default browser used by the ipython/jupyter notebook in Linux?

From Dev

ggvis in jupyter/ipython notebook

From Dev

ipython/Jupyter notebook with authentication

From Dev

port usage in the ipython notebook

From Dev

changing directory in ipython notebook

From Dev

Open 'ipython notebook' as: IPython notebook vs Jupyter

From Dev

Changing port in Apache Traffic Server: Default is 80

From Dev

Default notebook directory in iPython Notebook - iPython 3.0.0

From Dev

autoupdate module in IPython / jupyter notebook

From Dev

Jupyter (IPython) notebook: Convert an HTML notebook to ipynb

From Dev

ipython notebook command in anaconda opens jupyter notebook?

From Dev

iPython Notebook svg Figures by Default

From Dev

Changing the default Gitlab port

From Dev

Changing the default Gitlab port

From Dev

Changing default port of eureka server using spring cloud

From Dev

Automate standard jupyter/ipython notebook imports

From Dev

How to type in norm (latex) in ipython notebook (Jupyter)?

From Dev

Export individual cell in IPython/Jupyter notebook

From Dev

IPython/Jupyter notebook shortcut not working on Mac

From Dev

R: is there something like iPython notebook (jupyter) for R?

From Dev

Can a Jupyter / IPython notebook take arguments in the URL?

From Dev

Using ipython magics in R jupyter notebook?

From Dev

Change level logged to IPython/Jupyter notebook

From Dev

How to add automatically extension to Jupyter (ipython) notebook?

From Dev

Anaconda: Python 3 and 2 in IPython/Jupyter Notebook

From Dev

R not producing a figure in jupyter (IPython notebook)

From Dev

How to connect Jupyter Ipython notebook to Amazon redshift

Related Related

  1. 1

    Default template for iPython notebook (using Jupyter)

  2. 2

    IPython/Jupyter notebook 3 - hide headers by default

  3. 3

    How to change the default browser used by the ipython/jupyter notebook in Linux?

  4. 4

    ggvis in jupyter/ipython notebook

  5. 5

    ipython/Jupyter notebook with authentication

  6. 6

    port usage in the ipython notebook

  7. 7

    changing directory in ipython notebook

  8. 8

    Open 'ipython notebook' as: IPython notebook vs Jupyter

  9. 9

    Changing port in Apache Traffic Server: Default is 80

  10. 10

    Default notebook directory in iPython Notebook - iPython 3.0.0

  11. 11

    autoupdate module in IPython / jupyter notebook

  12. 12

    Jupyter (IPython) notebook: Convert an HTML notebook to ipynb

  13. 13

    ipython notebook command in anaconda opens jupyter notebook?

  14. 14

    iPython Notebook svg Figures by Default

  15. 15

    Changing the default Gitlab port

  16. 16

    Changing the default Gitlab port

  17. 17

    Changing default port of eureka server using spring cloud

  18. 18

    Automate standard jupyter/ipython notebook imports

  19. 19

    How to type in norm (latex) in ipython notebook (Jupyter)?

  20. 20

    Export individual cell in IPython/Jupyter notebook

  21. 21

    IPython/Jupyter notebook shortcut not working on Mac

  22. 22

    R: is there something like iPython notebook (jupyter) for R?

  23. 23

    Can a Jupyter / IPython notebook take arguments in the URL?

  24. 24

    Using ipython magics in R jupyter notebook?

  25. 25

    Change level logged to IPython/Jupyter notebook

  26. 26

    How to add automatically extension to Jupyter (ipython) notebook?

  27. 27

    Anaconda: Python 3 and 2 in IPython/Jupyter Notebook

  28. 28

    R not producing a figure in jupyter (IPython notebook)

  29. 29

    How to connect Jupyter Ipython notebook to Amazon redshift

HotTag

Archive