Skip to content

Instantly share code, notes, and snippets.

@Dawny33
Created November 7, 2017 02:27
Show Gist options
  • Save Dawny33/685720d591a919b2dbc4cb0d324a878c to your computer and use it in GitHub Desktop.
Save Dawny33/685720d591a919b2dbc4cb0d324a878c to your computer and use it in GitHub Desktop.
This gist is a simple explanation about how to connect and access your Jupyter notebooks on the P2 instance, from your local browser.
I had some problems with directly accessing port 8888 of my server for Jupyter. However, the following steps helped in sorting that out.
The following steps assume that you already have a P2 instance running with the `DeepLearning Ubuntu` AMI
- Jupyter would already be installed in your server if you are running the DeepLearning AMI
- Start Jupyter with `jupyter notebook`
- Once it gets started, switch to local and connect to the server via SSH tunnelling. [Helpful Link](https://stackoverflow.com/a/47021559/4993513). The command looks like this: `ssh -i /path/to/your/AWS/key/file -NL 8157:localhost:8888 user@host`. (We are using port 8157 here. But you can use any of the available ports for the purpose).
- Once that is done, the Jupyter notebook can be connected via the localhost by accessing port 8157 which in turn is connected to our instance via the SSH tunnel. The Jupyter notebook can be run as: `http://localhost:8157/`
- Keep in mind that when running it for the first time, you might be asked to authenticate yourself via a token mentioned in the remote when Jupyter is launched. The token would get cached after authentication for future access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment