set up jupyter lab in AWS lightsail

0

I want to run a Jupyterlab server in AWS lightsail. I create a lightsail instance (bitnami LAMP), install anaconda, install jupyter -- everything goes well. If I edit

~/htdocs/index.html

I can see the result in an external browser by going to

http://34.345.3.190

(pretending that 34.345.3.190 is my lightsail instance's IP address), so apache is working and port 80 is open. If I run

jupyter-lab --no-browser

from inside the lightsail instance (having ssh'd in), everything appears to be fine, so no problem with jupyterlab. It tells me to access jupyter at http://localhost:8888/lab

Now I go to Networking in my lightsail instance and "add a rule" choosing Custom, TCP, 8888 to open the 8888 port, but this is where things go wrong.

http://34.345.3.190:8888/lab

gives me "unable to connect" in my external browser.

If I run

ss -tuln | grep 8888

I get

tcp   LISTEN 0      128                           127.0.0.1:8888        0.0.0.0:*

If I run

sudo nmap -sT -O localhost

I get

PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
3306/tcp open  mysql
8888/tcp open  sun-answerbook
Device type: general purpose

If I run

netstat -antop | grep 8888

I get

tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      6911/python3.9       off (0.00/0/0)

This sounds relevant, but it's EC2 specific and I couldn't get it to work in lightsail:

https://docs.aws.amazon.com/dlami/latest/devguide/setup-jupyter-configure-client-linux.html

asked 2 years ago414 views
1 Answer
1

Jupyter needs additional configuration in order to receive connections from origins other than localhost. Have you tried the solution described here? https://stackoverflow.com/a/43500232

AWS
answered 2 years ago
  • Thank you! Let me try. I'll report back.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions