Skip to content

Instantly share code, notes, and snippets.

@HuakunShen
Last active July 2, 2021 05:54
Show Gist options
  • Save HuakunShen/3331f21666a9d01f76bbded2796b04e6 to your computer and use it in GitHub Desktop.
Save HuakunShen/3331f21666a9d01f76bbded2796b04e6 to your computer and use it in GitHub Desktop.
Remote Jupyter notebook

Option 1

Run this command on server

jupyter notebook --no-browser --ip <private ip> --port 8888

Access with http://<private ip>:8888

Option 2

Run this command on server

jupyter notebook --no-browser --port 8888

Run this command from client

ssh 8080:localhost:8888 <username>@<private ip>

Then access through http://localhost:8080

Remember to add token to the url for the first time, token is printed to stdout when starting the server.

Use SSL for Encrypted Communication

# generate keys
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem

# run notebook with the keys for encryption
jupyter notebook --certfile=mycert.pem --keyfile mykey.key

The SSL option can also be used with the options in the previous 2 option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment