Now the local port 8888 will be forwarded to the machine where your jupyter notebook will be running.
3) Start a screen session
notebook
screen -S my-session-name
You will notice that the terminal session was renewed. This is your screen session.
4) Starting the jupyter notebook. Navigate in the folder where your jupyter notebooks are stored and type the following command for Jupyter Lab
notebook
jupyter lab
or for a simple Jupyter Notebook
notebook
jupyter notebook
5) Open the notebook session. During startup jupyter will provide you with a link to your notebook server.
http://localhost:8888/?token=?...?
You can enter this link in your browser as long as our SSH session is active. You need the token to verify that you are the right user. Otherwise any person could user your notebook.
6) Detach the screen session. When you are done developing and want to close your session you go to your terminal where your screen session is running and press Ctrl + A on your keyboard. Now screen waits for a command. Since we do not want to kill the session and just detach it you can now press the key D. You will see that the session is detached but still runs in the background with your jupyter notebook. (Refer to https://wiki.ubuntuusers.de/Screen/ for more details)
5) If you want to shutdown your notebook and your screen session you can press Ctrl + C to shut down your notebook. If you now type exit your screen session will be closed.
Please remember to close your screen sessions if you do not need them any more, since you are blocking unattended updates of the host you are working on.