Jupyter Notebook has become an essential element of exploratory data analysis and data visualization pipelines. In this note, I will give the instructions on how to start a jupyter kernel remotely and connect to it.
- On the server, install Jupyter Notebook
- On the server, initialize a kernel using an arbitrary port number (e.g., 1234)
jupyter notebook --no-browser --ip=localhost --port=1234
. Copy the token number from the output log. Note you can use any port number. - On the local, execute
ssh -N -f -L localhost:8888:localhost:1234 user@server
where you need to replaceuser
with your username andserver
with your server. This command will initiate a channel from server'slocalhost:1234
to local'slocalhost:8888
. Again, you can use any port number. You just need to be consistent. - Go to
localhost:8888
in your local browser, you may need to enter the token number which you have copied in step 2.
In case you forget the Token number, execute the following command on the