Connecting to JupyterLab

When you start an AI Platform Deep Learning VM Image instance, a JupyterLab session is initialized.

Follow these steps to set up local port forwarding and then access your JupyterLab session through a local browser:

  1. Type the following command in either Cloud Shell or any environment where the Cloud SDK is installed. Replace my-project-id, my-zone, and my-instance with the relevant information.

    export PROJECT_ID="my-project-id"
    export ZONE="my-zone"
    export INSTANCE_NAME="my-instance"
    gcloud compute ssh --project $PROJECT_ID --zone $ZONE \
      $INSTANCE_NAME -- -L 8080:localhost:8080
  2. In a local web browser, visit http://localhost:8080 to access JupyterLab.