Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection refused (503 error) after running jupyter notebook

Tags:

I've installed conda and anaconda in a redhat server system. When I run jupyter with root user:

    jupyter notebook --port 8889 --allow-root --no-browser

everything seems to be ok and jupyter is successfully running.

    [I 10:25:44.091 NotebookApp] JupyterLab extension loaded from 
     /anaconda3/lib/python3.7/site-packages/jupyterlab
    [I 10:25:44.091 NotebookApp] JupyterLab application directory is /anaconda3/share/jupyter/lab
    [I 10:25:44.094 NotebookApp] Serving notebooks from local directory: /anaconda3/share
    [I 10:25:44.094 NotebookApp] The Jupyter Notebook is running at:
    [I 10:25:44.094 NotebookApp] http://localhost:8889/?token=47727d960f404202b179027ea871fd5fda8cfed87307cad4
    [I 10:25:44.094 NotebookApp] Use Control-C to stop this server and shut 
    down all kernels (twice to skip confirmation).
   [C 10:25:44.098 NotebookApp]

     To access the notebook, open this file in a browser:
      file:///root/.local/share/jupyter/runtime/nbserver-12424-open.html
     Or copy and paste one of these URLs:
        http://localhost:8889/?token=47727d960f404202b179027ea871fd5fda8cfed87307cad4

However, when I try to access the URL given to me in my browser (in windows), I get a 503 error. I use the given URL just I change localhost by the server hostname. any help ! Thanks

like image 328
D.Hajer Avatar asked Jan 04 '19 09:01

D.Hajer


1 Answers

If you're connecting to the Jupyter server from another device (not localhost), you will need to allow outside IP addresses. You can do this either by specifying:

--ip=0.0.0.0 or --ip=*

If you wish to restrict access to only a whitelist of IPs, these can also be specified here (or in the jupyter_notebook_config.py file)

Try: jupyter notebook --port 8889 --allow-root --no-browser --ip=0.0.0.0

like image 98
Lucas Durand Avatar answered Nov 14 '22 23:11

Lucas Durand