skip to Main Content

I’m running Amazon Linux 2 AMI EC2 instance. On the instance, I’m able to install anaconda. After setting jupyter notebook config etc. I tried to open jupyter notebook on Chrome using the url https://ip-xxx-xx-x-xx.us-east-2.compute.internal:8888/ from nohup.out. The link never worked.
enter image description here
1. Here is my Network settings:
enter image description here

2. And here is my jupyter notebook config:

c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ec2-user/certs/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# Your password below will be whatever you copied earlier
c.NotebookApp.password = u'xxxxx'
c.NotebookApp.port = 8888

3. And here is the log after running nohup jupyter notebook:

[I 15:51:03.957 NotebookApp] Writing notebook server cookie secret to /home/ec2-user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 15:51:04.525 NotebookApp] JupyterLab extension loaded from /home/ec2-user/anaconda3/lib/python3.8/site-packages/jupyterlab
[I 15:51:04.525 NotebookApp] JupyterLab application directory is /home/ec2-user/anaconda3/share/jupyter/lab
[I 15:51:04.528 NotebookApp] Serving notebooks from local directory: /home/ec2-user/Notebook
[I 15:51:04.528 NotebookApp] The Jupyter Notebook is running at:
[I 15:51:04.528 NotebookApp] https://ip-xxx-xx-x-xx.us-east-2.compute.internal:8888/
[I 15:51:04.528 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

In addition, the list of commands I ran to download Anaconda and configure jupyter notebook:

wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
bash Anaconda3-2020.07-Linux-x86_64.sh
source .bashrc
conda update conda
jupyter notebook --generate-config
mkdir certs
cd certs
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
cd ~/.jupyter/
nano jupyter_notebook_config.py
cd ..
mkdir Notebook
cd Notebook
nohup jupyter notebook

I believe it should be a security setting issue. But I already allowed SSH traffic from anywhere and also allow HTTPs traffic from the internet.

See inbound rules below:
enter image description here

Anything wrong with the above? Please share if you have any clues. Thanks!!

2

Answers


  1. Did you try using the public dns that’s listed on your EC2 instance? This is considering you have configured your EC2 in a public subnet that has an internet gateway.

    Login or Signup to reply.
  2. This may not help, but if you’re SSH’ing into the EC2 instance, try going to your instance in your AWS account after starting your jupyter server and click directly on the Public IPv4 DNS link. It will open a new tab that will likely fail to load. Add :8888 or whatever the server says the port is to the end of that URL and hit enter. It might ask for a token, which you can grab from your console where you ran the server.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search