Jupyter Notebook doesn't launch in browser-site can't be reached

Hi,

I have followed the steps to setup AWS instance and I am connecting using Putty -IP and Port 22.

Now I am able to connect to EC2 instance, update fastai using git pull and do a conda env update.

After I launch the Jupyter notebook , I get the link with token, but when I copy the link to browser it says -

This site can’t be reached

localhost refused to connect.
Search Google for localhost 8889
ERR_CONNECTION_REFUSED

As you can see from the message, there’s already a Jupyter Notebook running in Port 8888, hence a new Notebook instance is started in 8889. I suspect you are tunneling port 8888 and not 8889 in your ssh syntax (please share your ssh syntax here to verify). Make sure you are tunneling port similar to -
ssh -i <pem key> ubuntu@<ec2...> -L 8888:localhost:8888

Type - jupyter notebook list on your AWS terminal. This should show you that notebook running in 8888. If that doesn’t resolve it, restart your AWS machine and see if that fixes it (meaning kills the process that’s holding port 8888 in AWS - which most likely is another jupyter notebook).

2 Likes

Hey Ramesh,

Thanks for the reply.

I am connecting via Putty , so not running any tunneling command as such.

Can I do tunneling via putty to 8888?

I don’t use putty, But a quick google search found this link that suggests that you need to select “Tunnels” tab inside the SSH section and specify there - http://realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html

If that doesn’t help resolve the issue, please re-post here and I am sure other who use putty can help.

3 Likes

Yup I’ve used putty in that way - works fine for me.

Thanks Ramesh and Jeremy

I am able to launch Jupyter notebook now.

Hi @jeremy & @ramesh ,

I am having the same issue and was following the link.

In the “Tunnels” tab, within destination, do I put the EC2 instance public ip and the port?

Eg: 34.231.142.182:8888

Let me know.

hi @Gaurav85
please help me to resolve same issue i’m facing while opening my jupyter notebook i’m a beginner

Hi Avinash… I am using putty to connect to AWS and then launching the the Jupyter Notebook there (copy the url with token in my local browser).

What issue are you facing exactly and how do you connect ?

Hey @Gaurav85
thanks for reply

while i’m launching jupyter notebook it displaying (copy the url with token on my local browser) by the way i’m not using Aws or putty. how to resolve this problem ?

If you are running jupyter on a remote machine, try changing ‘localhost’ in the url to the IP of the remote machine.

If you have a different setup, describe it for us so we understand what is going on.