Open cmd/terminal and connect the local port to the remote server port.
ssh -L 127.0.0.1:3000:0.0.0.0:1234 USER@IP
For starting the docker, make sure to keep the port same as provided above. An example of starting a docker is given below.
docker run -it -p 1234:8888 IMAGENAME /bin/bash
Now that you have run the above command with /bin/bash
, it will take you inside the docker container. Make sure to have jupyter notebook installed in there. Run the following command inside the docker container terminal.
jupyter notebook --ip 0.0.0.0 --allow-root
After running the above command, something like http://127.0.0.1:8888/?token=2617735e9f289f5f318a8c0e
will be outputed. Replace the 8888
in the address with the port you provided in the first step i.e. 3000
and paste the link http://127.0.0.1:3000
in your local browser. It will ask for a token; paste the token from the link there and enjoy using jupyter notebook.