Skip to content

Instantly share code, notes, and snippets.

@vishnuexe
Last active October 17, 2024 08:50
Show Gist options
  • Select an option

  • Save vishnuexe/72db09d3340d2390f38b0079e3687212 to your computer and use it in GitHub Desktop.

Select an option

Save vishnuexe/72db09d3340d2390f38b0079e3687212 to your computer and use it in GitHub Desktop.

Accessing Jupyter-lab running inside docker in remote ssh server

Step1: ssh into your remote server

$ ssh username@server_ip_address

Step2: Run this in the remote server

#running docker with port assignment
#replace image:version with your docker image id
$ docker run --gpus all -it -p 8888:8888 image:version

Step3: Run this inside docker

#starting jupyter lab
$ jupyter lab --ip 0.0.0.0 --port 8888 --no-browser --allow-root

Step4: Run this in your local sytem

#port forwarding from remote server to local system
$ ssh -N -L 8888:localhost:8888 username@server_ip_address

Step 5:

Access the notebook through your desktop browser on http://localhost:8888 Copy paste the token which was generated when you started the server which you will find from Step 3 It will look something like this:

http://127.0.0.1:8888/lab?token=329ef3077dd75af702fdb038b1869b398850054de2e2a540

Copy everything after "token=" and paste it where it is asked.

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